Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 91461 invoked from network); 10 Feb 2011 14:26:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Feb 2011 14:26:52 -0000 Received: (qmail 97768 invoked by uid 500); 10 Feb 2011 14:26:52 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 97452 invoked by uid 500); 10 Feb 2011 14:26:50 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Delivered-To: moderator for users@camel.apache.org Received: (qmail 70932 invoked by uid 99); 10 Feb 2011 14:05:53 -0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cmoulliard@fusesource.com designates 74.125.245.80 as permitted sender) MIME-Version: 1.0 In-Reply-To: <4D53ECCF.3070605@progress.com> References: <1297345351891-3379301.post@n5.nabble.com> <4D53ECCF.3070605@progress.com> Date: Thu, 10 Feb 2011 15:05:25 +0100 Message-ID: Subject: Re: Problem with multiple CXF services using the same https port From: "Moulliard, Charles" To: users@camel.apache.org Content-Type: multipart/alternative; boundary=001636b4311dbea48e049bee1238 --001636b4311dbea48e049bee1238 Content-Type: text/plain; charset=ISO-8859-1 Hi, To avoid that jetty creates both HTTP servers competing for the same port number, you must use a relative path for the address address="https://0.0.0.0:8443:/Services/OrderEntry" --> address="/Services/OrderEntry". In this case, the camel cxf servlet will be registered with the Servlet Engine configured by default. Here is an example : http://camel.apache.org/cxf-tomcat-example.html Regards, Charles On Thu, Feb 10, 2011 at 2:49 PM, Adrian Trenaman wrote: > Hi Christian, > > Both bundles are separately competing for the same port - so whoever gets > it first wins, and the loser then complains. AFAIK, this will happen for > both HTTP and HTTPS ports; I'm not sure of a way to share the port using the > normal CXF configuration. > > However, you could just configure the CXF services to use the OSGi HTTP > service from ServiceMix, and then put your SSL/TLS configuration on that > port. Would that work for you? > > Cheers, > Ade > > On 10/02/2011 13:42, Christian Mueller wrote: > >> >> Hello list! >> >> In our ServiceMix 4.2.0-fuse-02-00 we deployed multiple Camel bundles >> which >> provides web services using Apache Camel. In the first phase we used http >> for all services. All services used the same port number and different >> context paths. >> In phase two, we tried to switch all endpoints to https with the following >> (general) configuration: >> >> {code} >> > address="https://0.0.0.0:8443:/Services/OrderEntry" >> >> serviceClass="com.xxx.yyy.interfaces.oe.OrderEntryWebService" >> endpointName="ssp:OrderEntryPort" >> serviceName="ssp:OrderEntryService" >> wsdlURL="META-INF/oe/orderEntry.wsdl" >> xmlns:ssp="http://www.xxx.com/oe/services/2"> >> >> >> > /> >> >> >> >> >> >> >> >> > password="password" file="keyStore.jks" /> >> >> >> .*.* >> >> > required="false" /> >> >> >> >> {code} >> >> But now, we receive the following exception when we deploy the second >> service (using the same https port): >> >> {code} >> karaf@root> Exception in thread "SpringOsgiExtenderThread-25" >> org.apache.camel.RuntimeCamelException: org.apache.cxf.intercep >> tor.Fault: Could not start Jetty server: Address already in use: JVM_Bind >> at >> >> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1055) >> at >> >> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103) >> at >> >> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:593) >> at >> >> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:7 >> 8) >> at >> >> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49) >> at >> >> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticast >> er.java:76) >> at >> >> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274) >> at >> >> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736) >> at >> >> org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleAppl >> icationContext.java:235) >> at >> >> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecu >> tionApplicationContext.java:358) >> at >> >> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) >> at >> >> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDele >> gatedExecutionApplicationContext.java:320) >> at >> >> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$Complet >> eRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136) >> at java.lang.Thread.run(Thread.java:619) >> Caused by: org.apache.cxf.interceptor.Fault: Could not start Jetty server: >> Address already in use: JVM_Bind >> at >> >> org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:371) >> at >> >> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:167) >> at >> >> org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:48) >> at >> >> org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:164) >> at >> >> org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:807) >> at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:127) >> at >> org.apache.camel.component.cxf.CxfConsumer.doStart(CxfConsumer.java:122) >> at >> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:53) >> at >> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49) >> at >> >> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:989) >> at >> >> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:197) >> at >> >> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101) >> ... 12 more >> Caused by: java.net.BindException: Address already in use: JVM_Bind >> at java.net.PlainSocketImpl.socketBind(Native Method) >> at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359) >> at java.net.ServerSocket.bind(ServerSocket.java:319) >> at java.net.ServerSocket.(ServerSocket.java:185) >> at java.net.ServerSocket.(ServerSocket.java:141) >> at javax.net.ssl.SSLServerSocket.(SSLServerSocket.java:84) >> at >> >> com.sun.net.ssl.internal.ssl.SSLServerSocketImpl.(SSLServerSocketImpl.java:79) >> at >> >> com.sun.net.ssl.internal.ssl.SSLServerSocketFactoryImpl.createServerSocket(SSLServerSocketFactoryImpl.java:65) >> at >> >> org.mortbay.jetty.security.SslSocketConnector.newServerSocket(SslSocketConnector.java:450) >> at >> >> org.apache.cxf.transport.https_jetty.CXFJettySslSocketConnector.newServerSocket(CXFJettySslSocketConnector.java:13 >> 9) >> at >> org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73) >> at >> org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:283) >> at >> org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147) >> at >> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) >> at org.mortbay.jetty.Server.doStart(Server.java:235) >> at >> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) >> at >> >> org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:338) >> ... 23 more >> >> {code} >> >> Did we something wrong? Is there another possible configuration which >> works? >> >> Thanks in advance for any help, >> Christian >> > -- -- Charles Moulliard - Sr. Principal Solution Architect FuseSource Phone: +32 473 604 014 Email: cmoulliard@fusesource.com Web: http://cmoulliard.blogspot.com, http://fusesource.com Twitter: cmoulliard "The experts in open source integration and messaging." --001636b4311dbea48e049bee1238--