[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: Overriding universal classloader, JBoss 4.2.1GA

jimpo do-not-reply at jboss.com
Wed Oct 10 06:22:03 EDT 2007


"jimpo" wrote : "jaikiran" wrote : anonymous wrote : java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
  |   | 
  |   | Have a look at http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassCastExceptions, specifically the jmx-console method mentioned over there. That will tell you which jar(and how many jars) is being picked up for this class.
  |   | 
  | 
  | Hmmm. I try it for org.apache.xerces.jaxp.SAXParserFactoryImpl, and get 
  | 
  | org.apache.xerces.jaxp.SAXParserFactoryImpl Information
  | Repository cache version:
  | org.apache.xerces.jaxp.SAXParserFactoryImpl(d73c3c).ClassLoader=null
  | ++++Null CodeSource
  | Implemented Interfaces:
  | 
  | ### Instance0 via UCL: org.jboss.system.server.NoAnnotationURLClassLoader at 5d173
  | 
  | Null CodeSource? Does this mean the class exists or not?
  | 
  | The war I am trying to deploy to JBoss deploys fine on a standalone Tomcat.

I see you latest comment, but the same error for DocumentBuilderFactorImpl:

org.apache.xerces.jaxp.DocumentBuilderFactoryImpl Information
Repository cache version:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl(12fa617).ClassLoader=null
++++Null CodeSource
Implemented Interfaces:

### Instance0 via UCL: org.jboss.system.server.NoAnnotationURLClassLoader at 5d173


I guess it means the class is loaded, since searching for com.foo.BarClass results in different message: "Not loaded in repository cache".

But where is this class loaded from?

----------------------------------------

I am guessing the problem is something along the lines:
- JBoss starts up and loads it's own xmls using xerces parser
- This causes some JRE-wide setting that makes all DocumentBuilderFactories use xerces parser (not sure about what goes on behind the scenes here)
- my application is loaded, it starts to initialize Spring (spring.jar inside my war)
- Spring tries to load the xml files for configuration
- Because of the setting in the seconds step, it tries to use xerces parser
- My war classloader does not see the xerces parser (why?) 
- OR my war classloader sees the xerces parser but for some reason the code expects a different type....ok, I'm a bit lost here...

Question regarding the jboss-web.xml "tweak" - my war classloader still sees the universal classloader classes, if those classes do not exist in the war, right? It has to, otherwise I would have to for example include servlet API.jar in my war?

Thousand thanks fot the fast replies :) I have to go to a meeting now but will be back to fighting with this problem later.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093403#4093403

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093403



More information about the jboss-user mailing list