On Tuesday 23 September 2008 3:53:06 pm Glen Mazza wrote:
> dkulp wrote:
>
> Thanks Dan, two more questions if you know:
>
> 1.) Do you know why the META-INF/cxf/cxf-servlet.xml that you have listed
> in the context-param above is not included in cxf-all.xml?  Class
> conflicts?

Yea, that's the one you DON'T want on there unless you are running in a 
servlet.  In the standalone case, if you have that there, it replaces the 
jetty based transport (cxf-extension-http-jetty) with the servlet version of 
the http transport.  When not running in a servlet, that would be bad.  
Things like ws-addressing that bring up the jetty stuff for callbacks would 
not work.

> also
>
> 2.) As you and Ian have said, using the configuration file
> WEB-INF/cxf-servlet.xml brings in all of the components of CXF, i.e., is
> equivalent to exporting META-INF/cxf/cxf-all.xml.  What makes that
> automatically happen, where the components of the cxf-servlet.xml approach
> will equal the components in cxf-all.xml--does the cxf-servlet.xml approach
> import cxf-all.xml behind-the-scenes, or you manually need to add the
> components to the cxf-servlet.xml approach to keep the two approaches in
> sync?

In the WEB-INF/cxf-servlet.xml case, what really happens is that we create 
a "default" bus and thus the logic is exactly the same as occurs when 
creating a command line client/service.   In that case, the SpringBusFactory 
stuff grabs all the /META-INF/cxf/cxf-extension files it finds on the 
classpath (note: we're NOT talking about the xml files, 
literally "cxf-extension".   Literally, we call 
classloader.getResources("/META-INF/cxf/cxf.extension") to get the URL[]).   
Those files are lists of the xml files to actually load.   cxf-all.xml isn't 
in that list, it gets the raw cxf-extension-blah.xml files, but the affect is 
the same.  

Note: this is how companies like IONA/Progress provide extensions to CXF.   
They have /META-INF/cxf/cxf.extension files in their jars that point to their 
spring stuff.   When the bus is created, if those jars are on the classpath, 
they get picked up and the extra functionality is loaded automatically.

In anycase, once the "default" bus is loaded into the Servlet, we then create 
a child spring context with the WEB-INF/cxf-servlet.xml and refresh it thus 
causing the beans in there to load.  

The cxf-all.xml thing is relatively new (I think introduced in 2.0.7/2.1.1).   
We mostly added it cause the list of things you need to import to get "all" 
the functionality is growing.  WS-Policy, WS-SecurityPolicy, JAX-RS, etc... 
all are having things you'll need to import.


-- 
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog

Reply via email to