8 Replies Latest reply on Oct 11, 2006 3:00 PM by mta S

    JBoss 4.0.4GA and JAXB

    tdevos Newbie

      Hi everyone,

      I try to upgrade our JBoss 4.0.3SP1 to JBoss 4.0.4GA. In our application we make use of JAXB. In JBoss 4.0.3SP1 I added the JAXB JWSDP 1.6 libraries to the default/deploy/lib directory and everything worked fine.

      However, if I follow the same procedure for JBoss 4.0.4GA (putting the JAXB JWSDP 1.6 libraries in default/lib) I got the following exception when deploying the EAR file.

      java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException.

      Further investigation shows that this class is defined in 2 jars. jboss-j2ee.jar (source JBoss) and jaxb-api.jar (source JWSDP 1.6). However then if I delete the jaxb-api.jar it continues fails with classes he can`t find which is normal since they are not in the JBoss distribution.

      I found at the wiki that JWSDP is not supported anymore in JBoss 4.0.4GA but I need to use JAXB and this is not available in JBossWS as far as I know. Does anybody now how I can use JAXB in comination with JBoss 4.0.4GA?


      Tim De Vos

        • 1. Re: JBoss 4.0.4GA and JAXB
          tdevos Newbie


          In the mean time I didn`t find a solution for this problem. I already tried with:

           <!-- EAR deployer, remove if you are not using ear deployments -->
           <mbean code="org.jboss.deployment.EARDeployer"
           <attribute name="Isolated">true</attribute>
           <attribute name="CallByValue">true</attribute>

          But this still gives the error. Nobody has a solution?


          Tim De Vos

          • 2. Re: JBoss 4.0.4GA and JAXB
            Dimitris Andreadis Master

            Maybe, put the overriding library inside your scoped .ear

            • 3. Re: JBoss 4.0.4GA and JAXB
              tdevos Newbie

              Thank you for your reply Dimitris.

              I already tried that but this gives the same result. I tried to experiment further reading the wiki`s about the classloading issues but unfortunatly wihtout any result. I don`t understand why JBoss uses an own implementation of the javax.xml.bind package. Am I right that the the javax.* and java.* packages are always loaded through the default class loader. Maybe this explains, however doesn`t solve the problem.

              Am I right that in JBoss 4.0.3SP1 the JWSDP libraries where compatible but not for JBoss 4.0.4? Is it usefull to update to jwsdp 2.0? However, this contains an early access release of JAXB 2.0 and maybe this is not recommended for a production environment.


              Tim De Vos

              • 4. Re: JBoss 4.0.4GA and JAXB
                Dimitris Andreadis Master

                Better ask in the WebServices user forum

                • 5. Re: JBoss 4.0.4GA and JAXB
                  Thomas Diesler Master

                  The deprecated JAXB1.0 API classes in package javax.xml.bind.* have been removed in jboss-4.0.5.cr1

                  • 6. Re: JBoss 4.0.4GA and JAXB
                    tdevos Newbie

                    Thank you for solving this in the next release.

                    • 7. Re: JBoss 4.0.4GA and JAXB
                      Ramil Israfilov Newbie

                      we had the same issue as we were using JAXB2.0 databinding in our classes.
                      Until new release of JBOSS is out you can use workaround solution:
                      Copy jaxb-api.jar and jaxb-impl.jar into JBOSS_HOME/server/default/lib directory and in $JBOSS_HOME/server/default/conf/jboss-service.xml file add following line just after


                      <classpath codebase="${jboss.server.lib.url:lib}" archives="jaxb-api.jar,jaxb-impl.jar"/>

                      • 8. Re: JBoss 4.0.4GA and JAXB
                        mta S Newbie


                        Just checking if this is the same issue that I am facing with JBOSS 4.0.4 and JAXB2.0. Let me know.

                        I am getting this exception while creating JAXBContext. xml.bind is J2EE lib require jaxb.properties, whereas one in JAXB2.0 do not need one.

                        2006-10-11 11:46:32,049 ERROR [STDERR] Caused by: javax.xml.bind.JAXBException: Cannot load resource: com/engine/xml/jaxb.properties
                        2006-10-11 11:46:32,049 ERROR [STDERR] at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:97)

                        Let me try the workaround.