[SM-2115]ensure cxf servlet transport and cxf bc can share same bus out of box when deploy smx-cxf-bc in web container

git-svn-id: https://svn.apache.org/repos/asf/servicemix/smx3/trunk@1156463 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/cxf/CXFManagedServlet.java b/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/cxf/CXFManagedServlet.java
new file mode 100644
index 0000000..4779a6b
--- /dev/null
+++ b/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/cxf/CXFManagedServlet.java
@@ -0,0 +1,33 @@
+/**
+ * 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.servicemix.web.cxf;
+
+import javax.servlet.ServletConfig;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.transport.servlet.CXFNonSpringServlet;
+import org.apache.cxf.transport.servlet.ServletController;
+
+public class CXFManagedServlet extends CXFNonSpringServlet {
+
+    protected void loadBus(ServletConfig sc) {
+        setBus(BusFactory.newInstance().getDefaultBus());
+    }
+
+}
diff --git a/distributions/apache-servicemix-web/src/main/webapp/WEB-INF/web.xml b/distributions/apache-servicemix-web/src/main/webapp/WEB-INF/web.xml
index 650a41f..38b12e4 100644
--- a/distributions/apache-servicemix-web/src/main/webapp/WEB-INF/web.xml
+++ b/distributions/apache-servicemix-web/src/main/webapp/WEB-INF/web.xml
@@ -108,12 +108,12 @@
       <description>Apache CXF Endpoint</description>

       <display-name>cxf</display-name> 

       <servlet-name>cxf</servlet-name>

-      <servlet-class>org.apache.cxf.transport.servlet.CXFNonSpringServlet</servlet-class>

+      <servlet-class>org.apache.servicemix.web.cxf.CXFManagedServlet</servlet-class>

       <load-on-startup>1</load-on-startup>

   </servlet>

   <servlet-mapping>

       <servlet-name>cxf</servlet-name>

-      <url-pattern>/services/*</url-pattern>

+      <url-pattern>/cxfservices/*</url-pattern>

   </servlet-mapping>

 

 	  <welcome-file-list>