4 Replies Latest reply on Jan 18, 2012 11:13 AM by paris mbo

    jboss-app.xml for class loading issue

    mike just Master

      Hi jaikiran,

       

      Can you help me on writing the jboss-app.xml according to my application deployment or what else needs to be added on my current jboss-app.xml? I heard you tested jboss-app.xml and it worked perfectly in another thread. Pasting one piece of the the jar conflict error for your reference:

       

      11:26:43,437 ERROR [[/globalsight]] Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
      java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory
              at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:128)
              at com.sun.faces.config.ConfigureListener$WebXmlProcessor.getConfiguredFactory(ConfigureListener.java:698)
              at com.sun.faces.config.ConfigureListener$WebXmlProcessor.scanForFacesServlet(ConfigureListener.java:670)

       

       

      My current jboss-app.xml: (located at deploy/globalsight.ear/META-INF)

       

      <!DOCTYPE jboss-app PUBLIC
          "-//JBoss//DTD J2EE Application 5.0//EN"
          "http://www.jboss.org/j2ee/dtd/jboss-app_5_0.dtd">
      <jboss-app >
          <loader-repository>
              org.w3c:loader=globalsight.ear
              <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
          </loader-repository>
         
      </jboss-app>

       

      And my application structure:

       

      globalsight.ear

           cxe-ejb.jar

              META-INF

                  ejb-jar.xml

                  jboss.xml

                  MANIFEST.MF

           globalsight-web.war

               WEB-INF

                  web.xml

                  lib (here are all my application's jars)

                  classes

           META-INF

               application.xml

               jboss-app.xml

       

      If you want the list of my jars in WEB-INF/lib, please let me know and I can paste them for you later.

       

      I know you are busy, any help will be much appreciated though. I am really in urgent need for help.

        • 1. Re: jboss-app.xml for class loading issue
          mike just Master

          I made the jboss-app.xml (under globalsight.ear\META-INF directory) like:

           

          <!DOCTYPE jboss-app PUBLIC
              "-//JBoss//DTD J2EE Application 5.0//EN"
              "http://www.jboss.org/j2ee/dtd/jboss-app_5_0.dtd">
          <jboss-app>
            <loader-repository>  
              com.example:loader=globalsight.ear  
              <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
            </loader-repository>
          </jboss-app>

           

          and made jboss-web.xml (under globalsight-web.war\WEB-INF directory) like:

           

          <!DOCTYPE jboss-web PUBLIC  
                  "-//JBoss//DTD Web Application 5.0//EN" 
                  "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
          <jboss-web>
          <loader-repository>  
              com.example:loader=globalsight.ear  
              <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
            </loader-repository>
          </jboss-web>

          but got this error, could you advise? What order should I make in jboss-web.xml?

           

          Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: loader-repository not found as a child of jboss-web in unordered_sequence: security-role* max-active-sessions? webservice-description* class-loading? jacc-star-role-allow? message-destination* servlet* replication-config? passivation-config? context-root? security-domain? virtual-host* use-session-cookies? depends* {unordered_sequence jndiEnvironmentRefsGroup}?

          • 2. Re: jboss-app.xml for class loading issue
            mike just Master

            adding node <class-loading java2ClassLoadingCompliance="false"> in front of <loader-repository> in jboss-web.xml fixes above error, but the classcast exception still happens.

             

            11:26:43,437 ERROR [[/globalsight]] Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
            java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory

             

            Can Jboss 5.1.0 GA handle this problem now?

            • 3. jboss-app.xml for class loading issue
              Benjamin Seyinbour Expert

              Hi Mike,

               

              got this error, could you advise? What order should I make in jboss-web.xml?

               

              The order is in the "caused by

               

              java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory

               

              Check that you are not packaging "xercesImpl.jar" with your jar. JBoss has its own copy.

               

              Cheers.

              • 4. Re: jboss-app.xml for class loading issue
                paris mbo Newbie

                java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory

                 

                hi there, i have the same jboss deployment problem while deploying my webapp under jboss-5.1.0.GA, i find these answer in an other internet post :

                 

                jboss jboss 5 web app packaging and classloading

                 

                I was facing classloading issue in Jboss 5.1 and the following worked for me like a miracle. Actually in jboss 5.x it is enabled by default so we need to comment that.

                Unified classloader

                In JBoss 4 in order to unify tomcat and jboss classloaders one had to change true

                in jboss/server/default/deploy/jboss-web.deployer/META-INF/jboss-service.xml .

                It is no longer the case in JBoss 5, instead the following has to be commented :

                 

                <!–

                -1

                javax.servlet,org.apache.commons.logging

                  –>

                in jboss-5.1.0.GA/server/default/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml.