I don't know if this is the cause, but I recently noticed something with regard 
to the ConduitInitiatorManager that may be related (this was in 2.2.10, but 
didn't see a relevant change in 2.3.0).  The load order of the various 
TransportFactory beans isn't well guaranteed, and not depends-on to the 
ConduitInitiatorManager and DestinationFactoryManager, and the way the Spring 
map is injected into it may lead to flaky initialization order.  The order I 
was seeing was that the CondiutInitiator's were calling the 
registerConduitInitiator from their @PostConstruct methods, and then after, the 
ConduitInitiatorManagerImpl was getting the Spring map injected, which ended up 
clearing the "last one in wins" order of the registerConduitInitiator, and 
since no other registrations happened, the ClientOnlyHTTPTransportFactory was 
sitting in the first position for the namespaces that the 
JettyHttpTransportFactory was supposed to be overriding.  

It looks like DestinationFactoryManagerImpl follows the same pattern.  What 
could be happening here is that the JettyHttpTransportFactory is registering 
before the DestinationFactoryManagerImpl is initialized, then the 
DestinationFactoryManagerImpl gets initialized, then the SoapTransportFactory 
got initialized.  



-----Original Message-----
From: Stephane Nicoll [mailto:[email protected]] 
Sent: Friday, November 12, 2010 2:52 AM
To: [email protected]
Subject: Re: cxf 2.3 and Jetty 7

On Fri, Nov 12, 2010 at 10:43 AM, Willem Jiang <[email protected]>wrote:

>
>
> The SoapTransportFactory will try to locat the real TransportFactory by
> checking the address.
> You can find the code from SoapTransportFactory.getDestination() method.
>
> Can you just set the break point on the JettyHTTPTransportFactory?


Here is more information about this. In SoapTransportFactory#getDestination

* bi [BindingInfo http://schemas.xmlsoap.org/wsdl/soap/]
* address = http://localhost:7171/MathWebService
* transId= http://schemas.xmlsoap.org/soap/http

Which leads to a call on DestinationFactoryManagerImpl#getDestinationFactory
with the "http://cxf.apache.org/transports/http"; namespace. The problem is
that these are my destination factories:


   - [0] = {java.util.concurrent.concurrenthashmap$writethroughen...@3059}
   http://www.w3.org/2003/05/soap/bindings/HTTP/ ->
   org.apache.cxf.binding.soap.soaptransportfact...@12284af
   - [1] = {java.util.concurrent.concurrenthashmap$writethroughen...@3067}
   http://schemas.xmlsoap.org/soap/http ->
   org.apache.cxf.binding.soap.soaptransportfact...@12284af
   - [2] = {java.util.concurrent.concurrenthashmap$writethroughen...@3075}
   http://schemas.xmlsoap.org/wsdl/soap12/ ->
   org.apache.cxf.binding.soap.soaptransportfact...@12284af
   - [3] = {java.util.concurrent.concurrenthashmap$writethroughen...@3083}
   http://www.w3.org/2010/soapjms/ ->
   org.apache.cxf.binding.soap.soaptransportfact...@12284af
   - [4] = {java.util.concurrent.concurrenthashmap$writethroughen...@3091}
   http://schemas.xmlsoap.org/wsdl/http ->
   org.apache.cxf.transport.servlet.servlettransportfact...@b20090
   - [5] = {java.util.concurrent.concurrenthashmap$writethroughen...@3100}
   http://schemas.xmlsoap.org/wsdl/soap/http ->
   org.apache.cxf.binding.soap.soaptransportfact...@12284af
   - [6] = {java.util.concurrent.concurrenthashmap$writethroughen...@3108}
   http://cxf.apache.org/transports/http ->
   org.apache.cxf.transport.servlet.servlettransportfact...@b20090
   - [7] = {java.util.concurrent.concurrenthashmap$writethroughen...@3116}
   http://schemas.xmlsoap.org/soap/ ->
   org.apache.cxf.binding.soap.soaptransportfact...@12284af
   - [8] = {java.util.concurrent.concurrenthashmap$writethroughen...@3124}
   http://cxf.apache.org/transports/http/configuration ->
   org.apache.cxf.transport.servlet.servlettransportfact...@b20090
   - [9] = {java.util.concurrent.concurrenthashmap$writethroughen...@3132}
   http://schemas.xmlsoap.org/wsdl/http/ ->
   org.apache.cxf.transport.servlet.servlettransportfact...@b20090
   - [10] = {java.util.concurrent.concurrenthashmap$writethroughen...@3140}
   http://schemas.xmlsoap.org/soap/http/ ->
   org.apache.cxf.binding.soap.soaptransportfact...@12284af
   - [11] = {java.util.concurrent.concurrenthashmap$writethroughen...@3148}
   http://schemas.xmlsoap.org/wsdl/soap/ ->
   org.apache.cxf.binding.soap.soaptransportfact...@12284af

No Jetty in there and the returned factory is
obviously org.apache.cxf.transport.servlet.servlettransportfact...@b20090

I don't understand what is happening. I have the http-jetty jar in my
classpath and I also explicitely added the following in my spring config
file:
<import resource="classpath*:/META-INF/cxf/cxf-extension-http-jetty.xml"/>

Can we use wildcards for this thing? Maybe I am loading another
configuration file that registers the same transportId with another
protocol? The imports of my project on CXF are:

<import resource="classpath*:META-INF/cxf/cxf-servlet.xml"/>
<import resource="classpath*:META-INF/cxf/cxf.xml"/>
<import resource="classpath*:META-INF/cxf/cxf-extension-*.xml"/>

HTH,
S.

Reply via email to