cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Sébastien Scrève <jean-sebastien.scr...@atosorigin.com>
Subject Re: Migrating to CXF 2.2 in OpenEJB
Date Tue, 19 May 2009 09:33:34 GMT

Ok I understand better how CXF works now.

It seems OpenEJB guys decided not to use Spring to configure the bus, I'll
ask them why.
The following object is created in OpenEJB : ExtensionManagerBus. That's why
extensions are loaded up.
Using the default Bus does not seem to work as such with Spring. Is there
anything special to configure to get the same behavior as with
ExtensionManagerBus ?

Unfortunately, setting deferred to "false" does not help to load my
transport factory after jetty transport factory.

Many thanks for your help Dan !

Regards,

Jean-Sébastien Scrève.


dkulp wrote:
> 
> 
> If you are using spring (and thus the import of
> cxf-extension-http-jetty.xml), 
> the extension stuff shouldn't be occurring at all.  The extension stuff
> only 
> comes into play if spring isn't found (supposedly).    Can I get the stack 
> trace of when the extension stuff is occuring?
> 
> Also, you can try changing:
> deferred="true"
> to:
> deferred="false"
> 
> That may help as well with the extension stuff.
> 
> Dan
> 
> 
> On Mon May 18 2009 10:20:22 am Jean-Sébastien Scrève wrote:
>> Ok thanks Dan.
>>
>> I'd like to use your first workaround. I tried it but I encountered
>> another
>> problem.
>>
>> I defined a cxf-openejb.xml that looks like this :
>>
>> <import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />
>>
>> <bean class="org.apache.openejb.server.cxf.HttpTransportFactory"
>> lazy-init="false"
>> 
>> depends-on="org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory"
>>> <property name="bus" ref="cxf" />
>> 	<property name="transportIds">
>> 		<list>
>> 			<value>http://cxf.apache.org/transports/http/configuration</value>
>> 			<value>http://cxf.apache.org/bindings/xformat</value>
>> 			<value>http://www.w3.org/2003/05/soap/bindings/HTTP/</value>
>> 			<value>http://schemas.xmlsoap.org/soap/http</value>
>> 			<value>http://schemas.xmlsoap.org/wsdl/http/</value>
>> 			<value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
>> 		</list>
>> 	</property>
>> </bean>
>>
>> My bean is built after Jetty factory so that's fine.
>> However, Jetty factory is also defined as an extension.
>> Extensions are loaded later and override my HttpTransportFactory.
>> So I decided to define my own bus-extensions.xml that looks like :
>>
>> <extensions xmlns="http://cxf.apache.org/bus/extension">
>> 	<extension
>> 		class="org.apache.openejb.server.cxf.HttpTransportFactory"
>> 		deferred="true">
>>
>> <namespace>http://cxf.apache.org/transports/http/configuration</namespace>
>> 			<namespace>http://cxf.apache.org/bindings/xformat</namespace>
>> 			<namespace>http://www.w3.org/2003/05/soap/bindings/HTTP/</namespace>
>> 			<namespace>http://schemas.xmlsoap.org/soap/http</namespace>
>> 			<namespace>http://schemas.xmlsoap.org/wsdl/http/</namespace>
>> 			<namespace>http://schemas.xmlsoap.org/wsdl/soap/http</namespace>
>> 	</extension>
>> </extensions>
>>
>> However my extension is loaded after Jetty extension and I don't know how
>> to define an order in extensions definitions.
>>
>> Any idea ?
>>
>> Many thanks,
>>
>> Jean-Sébastien Scrève.
>>
>> dkulp wrote:
>> > Couple other workarounds:
>> >
>> > 1) Since you are using maven, don't pull in the
>> > cxf-rt-transport-http-jetty
>> > module at all.   If you aren't using any of the jetty things, don't
>> pull
>> > it
>> > in.
>> >
>> > 2) Have your own META-INF/cxf/cxf-extention-openejbhttp.xml or similar
>> > that
>> > defines your own destination bean that depends on the
>> > JettyHTTPTransportFactory and deferred as false.   In that way, your
>> bean
>> > will
>> > force jetty one to be created and registered, then spring will
>> initialize
>> > yours and thus can replace it.
>> >
>> > Dan
>> >
>> > On Fri May 15 2009 1:27:36 pm Jean-Sébastien Scrève wrote:
>> >> Dan,
>> >>
>> >> OpenEJB works with CXF 2.0.4 and unfortunately, it's not that easy to
>> >> switch CXF library version in that way.
>> >> However, I had time to dig into the problem.
>> >> The reason is JettyHTTPTransportFactory is set with deferred as
>> "false"
>> >> in
>> >> bus-extensions.xml.
>> >>
>> >> Here is what happened (simplified stacktrace):
>> >>
>> >> -> We register our destinationFactory into the factoryManager
>> >> (factoryManager.registerDestinationFactory).
>> >> -> We call publish() on the CxfEndPoint.
>> >> -> create() is called on JaxWsServerFactoryBean object.
>> >> -> ... some things happen
>> >> -> getBindingFactory() on BindingFactoryManager is called.
>> >> -> ExtensionManagerImpl loads extensions.
>> >>
>> >> When JettyHTTPTransportFactory is not deffered, this latter is loaded
>> >> and causes Jetty to startup.
>> >>
>> >> The only solution I found for now was to overload the
>> >> createBindingInfo() in JaxWsServerFactoryBean to register our
>> >> destination factory right after Jetty registered its destination
>> >> factories.
>> >>
>> >> I hope I was clear enough.
>> >>
>> >> Thanks in advance !
>> >>
>> >> Jean-Sébastien Scrève.
>> >>
>> >> dkulp wrote:
>> >> > Jean-Sébastien,
>> >> >
>> >> > I really don't think anything in that area should be much different.
>> >> > Not sure why you've run into an issue.   Could you point me to any
>> >> > information you
>> >> > might have about how to reproduce the issue?     Is it just the
>> >> > openejb trunk.
>> >> > "mvn install" with a flag for the cxf version?   Etc.....
>> >> >
>> >> >
>> >> > Dan
>> >> >
>> >> > On Wed May 13 2009 5:00:53 am Jean-Sébastien Scrève wrote:
>> >> >> Hello,
>> >> >>
>> >> >> OpenEJB now uses CXF 2.0.4 revision. I'm trying to make OpenEJB
use
>> >>
>> >> 2.2
>> >>
>> >> >> revision and I'm facing a problem.
>> >> >> When I call Server.create, CXF uses the Jetty transport factory.
>> >> >> With CXF 2.0.4 we were able to override the Jetty transport factory
>> >>
>> >> and
>> >>
>> >> >> register our own transport factory. It seems it does not work
>> anymore
>> >>
>> >> in
>> >>
>> >> >> CXF 2.2.
>> >> >> Any idea how to override the Jetty transport factory ?
>> >> >>
>> >> >> You can find hereafter a sample of the code used to override the
>> >> >> Jetty transport : (with CXF 2.0.4)
>> >> >>
>> >> >> DestinationFactoryManager factoryManager =
>> >> >> bus.getExtension(DestinationFactoryManager.class);
>> >> >> HttpTransportFactory factory = new HttpTransportFactory(bus);
>> >> >> factory.setTransportIds(ids);
>> >>
>> >>
>> factoryManager.registerDestinationFactory("http://cxf.apache.org/transpo
>> >>
>> >> >>rts /http/configuration", factory);
>> >>
>> >>
>> factoryManager.registerDestinationFactory("http://cxf.apache.org/binding
>> >>
>> >> >>s/x format", factory);
>> >>
>> >>
>> factoryManager.registerDestinationFactory("http://www.w3.org/2003/05/soa
>> >>
>> >> >>p/b indings/HTTP/", factory);
>> >>
>> >>
>> factoryManager.registerDestinationFactory("http://schemas.xmlsoap.org/so
>> >>
>> >> >>ap/ http", factory);
>> >>
>> >>
>> factoryManager.registerDestinationFactory("http://schemas.xmlsoap.org/ws
>> >>
>> >> >>dl/ http/", factory);
>> >>
>> >>
>> factoryManager.registerDestinationFactory("http://schemas.xmlsoap.org/ws
>> >>
>> >> >>dl/ soap/http", factory);
>> >> >>
>> >> >> Many thanks,
>> >> >>
>> >> >> Jean-Sébastien Scrève.
>> >> >
>> >> > --
>> >> > Daniel Kulp
>> >> > dkulp@apache.org
>> >> > http://www.dankulp.com/blog
>> >
>> > --
>> > Daniel Kulp
>> > dkulp@apache.org
>> > http://www.dankulp.com/blog
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/Migrating-to-CXF-2.2-in-OpenEJB-tp23518058p23612789.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message