JBoss Web Applications Classloader Conflict
nchivukula Jan 11, 2011 6:03 AMHi All,
I have been working on JBoss 5.1 quite some time and at the moment working on JAX-WS web services deployment. I'll state my question simple and elaborated for suitable readers.
Simple:
In my Jboss server deploy directory, I have few web applications (web applications include web service applications). In one, I used classloader isolation giving domain name my web application context, which should make Jboss server load the web application jars first and then server jars next if I'm not wrong. This particular web application having classloader isolation is causing server runtime issues(ExceptionInInitializerError of one of the classes present in WEB-INF/lib jars) when other web application already deployed is tested! I'm stunned by this as web applications normally have their own classloaders. Then, if I back out the problem web application, then the other works fine. Can someone explain or point to some link where I can study JBoss classloader mechanism in easily understandable version?
Elaborated:
Hoping you read above, I have few web service applications (all created using JAX-WS) running on JBoss 5.1. The web service jar files that these applications use are (in WEB-INF/lib directory)
(JAX-WS 2.1 API libraries)
webservices-api.jar
webservices-extra-api.jar
(JAX-WS 2.1 Runtime libraries Project Metro 1.1)
webservices-rt.jar
webservices-extra.jar
And the above web service applications don't have any class loader isolation.
I have a new web service A, which was tested on a different box on same JBoss 5.1 server but has no other web services applications. The web service jar files that this web application use is (in WEB-INF/lib directory)
jaxws-rt.jar
stax-ex.jar
streambuffer.jar
This web serivce application A has got class loader isolation.
When the new web service A is deployed with earlier web service applications, I get ExceptionInInitializerError when testing one of the earlier web service applications. The stack trace is as shown in the attached log. Obviously, it complains of having two classes with same @XmlType.name element annotations. But, those two classes are contained in two different jars, each in a different web application. They shouldn't conflict in any case. But, when I remove classloader isolation and add the four jars like in earlier web service applications, this works fine. Now, I should not be bothered of wondering all this why it failed in first case. But, I want to understand how JBoss works! Any thoughts highly appreciated.
Cheers,
Naren Chivukula
-
st.log.zip 1,018 bytes