8 Replies Latest reply on Jan 25, 2011 3:23 PM by rjbaty

    JBossAS6 CXF Web Services without Spring?

    rjbaty

      I've been following a number of posts on this forum as I seem to be running into a similar issue with the default CXF web service implementation for JBossAS6 and Spring.  Is there any way to have a project that has Spring libraries in EAR/WAR but have CXF not use Spring?  I seem to be working fine when there is no Spring in my app.  I can create web service clients and endpoints fine and CXF seems to use a non-Spring BusFactory, however, once I add a Spring jar to the app CXF detects it and boostraps a different factory eventhough I don't want to use Spring with CXF.

       

      Robert

        • 1. Re: JBossAS6 CXF Web Services without Spring?
          asoldano

          As far as the BusFactory is concerned, you can force JBossWS-CXF on using a given BusFactory the same way you'd do with Apache CXF. More in details, if you look at the contents of jbossws-cxf-factories.jar in lib/endorsed, you see a META-INF/services/org.apache.cxf.bus.factory file that's used to override the bus factory configuration. You can modify the contents of that file in the jar to use org.jboss.wsf.stack.cxf.client.configuration.JBossWSNonSpringBusFactory (which is the non-spring version of the jbossws modified bus factory, what the default jbossws-cxf bus factory delegates to when Spring is not found in the thread context classloader).

          However, depending on your app, you might have other problems achieving what you want to do, as basically the jbossws-cxf stack needs to detect if Spring is available in multiple points (when selecting the endpoint servlet, for instance, ...)

          You can consider creating a jira (and perhaps contributing a patch ;-) ), if you want, for this.

          • 2. JBossAS6 CXF Web Services without Spring?
            rjbaty

            Alessio,

            Thanks for the information.  I kinda got frustrated with this issue so I ended up installing the JBossWS-Native 3.4.1 implementation onto my JBossAS 6 server.  Since I had been using this implementation on pre-JBossAS 6 servers it seemed to work for me right away so I moved on to other things.  This raises an interesting point though, will JBossWS-Native still be a supported project moving forward now that you guys have decided to go with JBossWS-CXF as the default implementation for JBossAS 6?  Just wondering if I need to spend more time figuring out my CXF / Spring issues.

             

            Regarding JBossWS-CXF, if this web service engine is limited without Spring why don't you guys include the required Spring libraries in the server so teams don't run into these issues?  As it appears right now I need to get JBossAS 6 out of the box and then re-install the JBossWS-CXF implementation with Spring according to your documentation.

             

            Again, thanks for the info on the JBossWSNonSpringBusFactory

             

            Robert

            • 3. JBossAS6 CXF Web Services without Spring?
              asoldano

              Robert Baty wrote:

               

              Alessio,

              Thanks for the information.  I kinda got frustrated with this issue so I ended up installing the JBossWS-Native 3.4.1 implementation onto my JBossAS 6 server.  Since I had been using this implementation on pre-JBossAS 6 servers it seemed to work for me right away so I moved on to other things.  This raises an interesting point though, will JBossWS-Native still be a supported project moving forward now that you guys have decided to go with JBossWS-CXF as the default implementation for JBossAS 6?  Just wondering if I need to spend more time figuring out my CXF / Spring issues.

              Yes, JBossWS-Native is staying as a supported project moving forward. Please consider that the project is consumed by some of the Red Hat / JBoss products (JBoss EAP for instance), so bug/security fixes are going to be provided to both community and customers for years.

              Major new features though, especially in the WS-* area, are going to be implemented on top of JBossWS-CXF, which is also going to be part of products' new major releases.

               

               

              Regarding JBossWS-CXF, if this web service engine is limited without Spring why don't you guys include the required Spring libraries in the server so teams don't run into these issues?  As it appears right now I need to get JBossAS 6 out of the box and then re-install the JBossWS-CXF implementation with Spring according to your documentation.

               

              Yes, either you re-install jbossws-cxf with spring, or you simply copy your own spring libs to the proper AS folders (client and common/lib); the former solution is probably less error prone because it's been tested before releasing jbossws-cxf.

              In any case, the main reason for all this is that it appeared to be un-acceptable forcing a given version of Spring libs in the JBoss Application Server. Basically, users are willing to use different versions of Spring, hence shipping a given version would have mess up with many existing applications.

              For the future (AS 7) this "issue" is likely to be solved by the way the new modular classloading works.

              • 4. JBossAS6 CXF Web Services without Spring?
                rjbaty

                Alessio,

                Yes, I am a JBossEAP customer so we have used JBossWS-Native in the EAP product.  Getting and using JBossAS 6 is really to begin to understand features / direction JBoss is going for the EAP platform since many of your new AS features get put into EAP.  With your comments on JBossWS-Native it seems it may still be the primary implementation in EAP or have decisions on that still forthcoming?  I would just like to know as we have invested decently in the JBossEAP 5.x platform with JBossWS-Native so if with the upcoming JBossEAP 6 platform we need to begin looking at the CXF implementation I would like to understand that.

                 

                Robert

                • 5. JBossAS6 CXF Web Services without Spring?
                  asoldano

                  Robert, just to clarify a bit (please double-check with your customer support):

                  JBoss EAP 5.0 came with JBossWS-Native stack, a tech preview only with JBossWS-CXF was also available.

                  JBoss EAP 5.1 series is available and supported with both JBossWS-Native and JBossWS-CXF stacks. This means that every future CP and minor release for 5.1 will maintain support for both Native stack, for the full support time (7yrs as far as I remember)

                   

                  JBoss EAP 6 is going to come with support for JBossWS-CXF only.

                  • 6. JBossAS6 CXF Web Services without Spring?
                    rjbaty

                    Alessio Soldano wrote:

                     

                    Robert, just to clarify a bit (please double-check with your customer support):

                    JBoss EAP 5.0 came with JBossWS-Native stack, a tech preview only with JBossWS-CXF was also available.

                    JBoss EAP 5.1 series is available and supported with both JBossWS-Native and JBossWS-CXF stacks. This means that every future CP and minor release for 5.1 will maintain support for both Native stack, for the full support time (7yrs as far as I remember)

                     

                     

                    We are currently on EAP 5.0 and moving to EAP 5.1.  So I am sure no one has used JBossWS-CXF yet.  I checked the EAP documentation and you are correct CXF was a tech preview at EAP 5.0 and is now included in EAP 5.1 at 3.1.2.SP7.  So it would be available to teams on EAP 5.1 in 2011. (Just not as the default implementation)

                     

                    JBoss EAP 6 is going to come with support for JBossWS-CXF only.

                     

                    Thanks, this is exactly the informormation I needed.  So when we move from EAP 5.1 to EAP 6.0 we will have to migrate from JBossWS-Native to JBossWS-CXF implementations.  So time invested in figuring out CXF would definately be useful.

                     

                    Last question, and maybe this is stupid, I am not sure.  Since it appears you are going toward CXF and removing Native in EAP 6.0 (First JEE6 server released under EAP) why did you guys spend time upgrading Native to 3.4.1 and be supported on the JEE6-based JBossAS 6.0 server?  Why not cut bait with the project in the 5.1 branch?

                     

                    Robert

                    • 7. JBossAS6 CXF Web Services without Spring?
                      asoldano

                      Last question, and maybe this is stupid, I am not sure.  Since it appears you are going toward CXF and removing Native in EAP 6.0 (First JEE6 server released under EAP) why did you guys spend time upgrading Native to 3.4.1 and be supported on the JEE6-based JBossAS 6.0 server?  Why not cut bait with the project in the 5.1 branch?

                       

                      As of today, from a community point of view, we do want to keep JBossWS-Native available for / supported on the latest JBoss Application Server for multiple reasons; those include pleasing / giving more choices to the community, keeping an upstream version for the product version consumed by EAP 5.1.x, being able to apply patches upstream to the jaxrpc code (the JSR-101 features are still served by the Native stack even when using JBossWS-CXF for JAXWS), ...

                      • 8. JBossAS6 CXF Web Services without Spring?
                        rjbaty

                        Alessio, makes sense thanks.  I did notice you are still using JBossWS-Native in deployers/jbossws-jaxrpc.deployer of JBossAS 6.0 after I responded so it is still used for JAX-RPC services even with the CXF default impl.

                         

                        Thanks!

                         

                        Robert