2 Replies Latest reply on Jul 18, 2011 11:23 PM by Henri Tremblay

    How to have CXF/Spring in War?

    Henri Tremblay Newbie

      Hi, I'm on JBoss 5.0.0 (but can migrate to 5.0.1 or 5.1 if very necessary. JBoss 6 is impossible since the Red Hat support isn't supporting it).


      To prevent class loading issues with other applications already deployed on the server, I would like to deploy CXF and Spring in my ear instead of in JBoss (by using the CXF module).


      The main problem right now if that CXF has the @Resource annotation and JBoss tries to use it. So I want JBoss to ignore it and I'm also guessing that some jboss-classloading.xml will be needed and that I will need to exclude some VXF dependencies. My goal will be CXF 2.3.1.


      Any insight of how I can do this?





        • 1. How to have CXF/Spring in War?
          Alessio Soldano Master

          This is not going to be trivial; regarding having spring in your application, try looking at http://community.jboss.org/thread/160566

          • 2. Re: How to have CXF/Spring in War?
            Henri Tremblay Newbie

            I finally managed to do it. I've followed the explanations on this page


            I add to use and ear instead of a war and set the maven-ear-plugin to add a jboss-app.xml containing something like

            <?xml version="1.0" encoding="UTF-8"?>







            A tweak to the xbeans jar (used by some other code) to remove the w3c classes was also necessary.


            The JBoss is installed without the plugin CXF installed but it seems to work even if it's there.


            I don't have the detail at hand but I've also excluded a bunch of dependencies from cxf. They tend to include a lot of geronimo jars that are already provided by JBoss as a J2EE container. If someone ask, I'll get the complete list.


            However, there is still an issue pending. The hot deploy isn't working anymore (on Windows). I get and access denied on tmp\something at each redeploy when the ear is copied in the deploy dir. I don't know if it's because the copy takes too long or if it's because something more complicated is going on on the class loading side.


            Any thoughts?