You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2015/03/24 17:26:26 UTC

tomee git commit: trying to ensure we use our configurator and not tomcat one cause of 'no luck' effect

Repository: tomee
Updated Branches:
  refs/heads/master 639abb87a -> 9c6a31497


trying to ensure we use our configurator and not tomcat one cause of 'no luck' effect


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/9c6a3149
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/9c6a3149
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/9c6a3149

Branch: refs/heads/master
Commit: 9c6a31497f34955a81a495425c3393f78da59df0
Parents: 639abb8
Author: Romain Manni-Bucau <rm...@apache.org>
Authored: Tue Mar 24 17:26:17 2015 +0100
Committer: Romain Manni-Bucau <rm...@apache.org>
Committed: Tue Mar 24 17:26:17 2015 +0100

----------------------------------------------------------------------
 .../tomee/catalina/TomcatWebAppBuilder.java     |  6 ++++
 .../org/apache/tomee/catalina/WebSockets.java   | 32 ++++++++++++++++++++
 2 files changed, 38 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/9c6a3149/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
index d89b5f3..319293a 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
@@ -322,6 +322,12 @@ public class TomcatWebAppBuilder implements WebAppBuilder, ContextListener, Pare
         deploymentLoader = new DeploymentLoader();
 
         setComponentsUsedByCDI();
+
+        try { // before tomcat was using ServiceLoader or manually instantiation, now it uses SL for itself so we can be in conflict
+            WebSockets.setConfigurator();
+        } catch (final Throwable th) {
+            // no-op: can be another API impl, normally we are ok, this is really just a safe belt
+        }
     }
 
     private void setComponentsUsedByCDI() {

http://git-wip-us.apache.org/repos/asf/tomee/blob/9c6a3149/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/WebSockets.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/WebSockets.java b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/WebSockets.java
new file mode 100644
index 0000000..2781c95
--- /dev/null
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/WebSockets.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tomee.catalina;
+
+import org.apache.openejb.util.reflection.Reflections;
+import org.apache.tomee.catalina.websocket.JavaEEDefaultServerEnpointConfigurator;
+
+import javax.websocket.server.ServerEndpointConfig;
+
+public final class WebSockets {
+    private WebSockets() {
+        throw new UnsupportedOperationException();
+    }
+
+    public static void setConfigurator() {
+        Reflections.set(ServerEndpointConfig.Configurator.class, null, "defaultImpl", new JavaEEDefaultServerEnpointConfigurator());
+    }
+}