3 Replies Latest reply on Aug 14, 2013 4:03 AM by Alexander Hartner

    Using endorsed libraries to use custom Xalan/Xerces

    Alexander Hartner Expert

      The log from JBoss 7 reports the endorsed folder on startup as : java.endorsed.dirs = C:\Program Files\Java\jdk1.7.0_25\jre\lib\endorsed however after placing several libraries into this folder including our special version of xalan and serializer. However when trying to access the "special" version I am getting errors:


      java.lang.LinkageError: Failed to link org/apache/xalan/transformer/TransformerImpl

      java.lang.NoClassDefFoundError: org/apache/xml/serializer/SerializerTrace

      Any suggestions on how the endorsed mechanism works in JBoss 7.

        • 1. Re: Using endorsed libraries
          Alexander Hartner Expert

          I made a little progress on this issue. Looks like the endorsed mechanism has been replaced with jigsaw / modules. Not 100% certain of this and would be grateful if somebody could confirm my suspicion.


          So I tried to create a custom module and declare a dependency in my application


          Added jboss-deployment-structure.xml to the META-INF folder of my EAR

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





                <module name="com.abc.additional" export="true"/>

                <module name="com.abc.dependencies" export="true" />




          And added a new module folder and descriptor

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

          <module xmlns="urn:jboss:module:1.1" name="com.thunderhead.additional">


                <resource-root path="ABC-serializer-2.7.0.jar"/>

                <resource-root path="ABC-xalan-2.7.0.jar"/>

                <resource-root path="resolver.jar"/>



          This didn't help resolve the issue. Any suggestion on how to specify / override the default XML libraries for either a single application EAR or the entire JBoss installation.

          • 2. Re: Using endorsed libraries
            Stephen Coy Master

            What happens if you add the jars to your EAR/lib directory (and remove the jboss-deployment-structure.xml)?


            Are you using javax.xml.transform.TransformerFactory#newInstance(java.lang.String, java.lang.ClassLoader) to create your transformer factories?

            1 of 1 people found this helpful
            • 3. Re: Using endorsed libraries
              Alexander Hartner Expert

              This looks a little better, however now I am getting : NoClassDefFoundError: javax/naming/InitialContext. I already posted about this issue on a separate thread as a different part of the application is also running in to the same issue. Any idea where this class is. I can't find it in any of the modules or jar files.