3 Replies Latest reply on Sep 15, 2011 9:11 PM by hai qing

    class-loading issue - migrating legacy application. war only

    Wayne Yu Newbie

      I have a top level war file running properly in Tomcat, now I am trying to move it to Jboss AS 6 Final.



      Because of conflicts in XML parser/transformers,  I had to insulate this war file from everything else.  This is my jboss-classloading.xml under WEB-INF:



      <classloading xmlns="urn:jboss:classloading:1.0"


      name ="generator.war"


      top-level-classloader ="true"











      All of the libraries are put in WEB-INF/lib


      But then some class-loading issue start to show up, 


      class-nof-found problem: commons-configuration class can not find class in commons-lang.  But both jars are found in WEB-INF/lib,  then I extract classes from the jars and  jar them together in one single jar file,  still the same problem.




      : org.apache.commons.lang.text.StrLookup from BaseClassLoader@5fadce{vfs:///C:/jboss6/jboss-6.0.0.Final/server/default/conf/jboss-service.xml}






      at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(


      ) [jboss-classloader.jar:2.2.0.GA]

      at java.lang.ClassLoader.loadClass(


      ) [:1.6.0_15]

      at java.lang.ClassLoader.loadClassInternal(


      ) [:1.6.0_15]

      at org.apache.commons.configuration.ConfigurationFactory$ConfigurationBuilder.<init>(


      ) [:1.6]

      at org.apache.commons.configuration.ConfigurationFactory.getConfiguration(


      ) [:1.6]


      Another problem was illegal access error,  looks to be related to parent and child classes loaded from two different class-loaders.

      WARN [ClassLoaderManager] Unexpected error during load of:org.jaxen.dom.DocumentNavigator$7: java.lang.IllegalAccessError: class org.jaxen.dom.DocumentNavigator$7 cannot access its superclass org.jaxen.dom.DocumentNavigator$NodeIterator