1 Reply Latest reply on Dec 12, 2001 2:54 AM by Klaus Thiele

    ClassLoader problems w/ XML Parser all over

    christian sell Newbie


      I have an app (web, ejb and all) which brings its own XML parser and XSL transformer (Saxon) along in a jar file inside WEB-INF/lib.

      I have unsucessfully tried to run this app under JBoss2.4.3/Tomcat3.2.3 and JBoss2.4.4/Tomcat4.0. It seems that there are serious ClassLoader problems in these configurations, as I have sucessfully deployed this app under several other J2EE servers.

      Under JBoss2.4.3, my webapp sees an instance of TransformerFactory whose classloaders getURLs points to the run.jar and crimson.jar files ONLY. Since TransformerFactory performs a dynamic class lookup (Class.forName()) for the transfomer implementation class internally, it will always fail, no matter where I make my XSLT engine jar available.

      Under JBoss2.4.4, I have to remove the %JAXP% system properties from run.bat to be able to start my app. It then starts and is able to use the parser - else it would have got a ClassCastException because classes that did implement one interface could not be cast to that same interface (inside JAXP code), obviously because the interface definition was loaded from a different classloader. What a mess.

      Now I am left with an error, saying "System property org.xml.sax.driver not specified".

      Maybe the fact that my app uses the parser/transformer during servlet initialization bears some significance. Anyway, it looks to me like the classloader issue is not settled at all. My app is obviously seriously affected by the container class space, instead of being safe within its own 4 jar walls.

      Hints anyone?
      Christian Sell