3 Replies Latest reply on May 18, 2006 10:38 AM by ramazanyich

    order of jar loading from lib directory

      Hi, I have a problem with latest build of JBoss 4.0.4 RC1.
      our application uses JAXB2 for xml marshalling-unmarshalling. We put jaxb jar files to the jboss_home/server/default/lib directory.
      In previous version 4.0.3 it worked fine. But now then I try to run application I got exception.
      ---------
      Caused by: javax.xml.bind.JAXBException: Cannot load resource: be/certipost/jc/d
      ocumentdiscovery/content/mrt/jaxb.properties
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:97)
      ... 107 more
      2006-01-30 15:48:09,814 ERROR [be.certipost.jc.storage.Storage] Exception during

      --------
      We are running jboss on solarisx86 version 10.
      I found that in latest version jboss-j2ee.jar contains javax.xml.bind.* classes (which was not a case for jboss 4.0.3 jar).
      And class files on that package in jboss-j2ee.jar are from JAXB1.0 version and it causes a problem with JAXB2.

      My question is how to defined that jaxb-api.jar, jaxb-impl.jar files will be read before jboss-j2ee.jar file ?

        • 1. Re: order of jar loading from lib directory
          thomaslutz2005

          Hi,

          this post is pretty old, but a solution for it took quite a lot of time.

          If you want to use jaxb 2.0 in jboss-4.0.4RC2-20061505 see
          http://www.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration

          META-INF/jboss-app.xml :

          <jboss-app>
           <loader-repository>
           dot.com:loader=jaxb-impl.jar
           <loader-repository-config>
           java2ParentDelegation=false
           </loader-repository-config>
           </loader-repository>
           <loader-repository>
           dot.com:loader=jaxb-api.jar
           <loader-repository-config>
           java2ParentDelegation=false
           </loader-repository-config>
           </loader-repository>
           <loader-repository>
           dot.com:loader=jaxb-xjc.jar
           <loader-repository-config>
           java2ParentDelegation=false
           </loader-repository-config>
           </loader-repository>
           <loader-repository>
           dot.com:loader=jsr173_1.0_api.jar
           <loader-repository-config>
           java2ParentDelegation=false
           </loader-repository-config>
           </loader-repository>
          </jboss-app>


          • 2. Re: order of jar loading from lib directory

            I had another workaround. In conf/jboss-service.xml file there is a classpath config line.
            A just added my jar files as first element:


            • 3. Re: order of jar loading from lib directory

              Sorry worngly posted previous messages. So my jboss-service.xml is looks following:

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