-
1. Re: xerces class cast exception
jaikiran Jul 6, 2011 10:17 AM (in response to prasad.deshpande)Please post the entire exception stacktrace and if possible attach the application to reproduce this.
-
2. Re: xerces class cast exception
prasad.deshpande Jul 6, 2011 10:48 AM (in response to jaikiran)I don't have big stack.. just a simple line saying clas clast exception. I'm trying to create a sample ear as a test case.
-
3. Re: xerces class cast exception
kabirkhan Jul 6, 2011 10:57 AM (in response to prasad.deshpande)Prasad Deshpande wrote:
I tried to remove one from my ear, that gave me no class definition found exception, that means xercesImpl.jar from modules is not visible to my ear directly, but then what could be the reason for this exception? I tried jboss-deployment-structure.xml in META-INF of ear
Did you try adding a
Dependencies: org.apache.xerces
to your ear's META-INF/MANIFEST.MF?
-
4. Re: xerces class cast exception
prasad.deshpande Jul 6, 2011 11:40 AM (in response to jaikiran)This is the closest I can get you to. just deploy this ear & try to access http://localhost:8080/jndiView/JNDITree and you should get the exception.
Surely something to do with classloading, am I missing anything here?
@Kabir, yes, I tried your solution too, still same.
-
Test.java.zip 574 bytes
-
JNDITree.java.zip 1.4 KB
-
a.ear.zip 1.1 MB
-
-
5. Re: xerces class cast exception
jaikiran Jul 6, 2011 1:15 PM (in response to prasad.deshpande)I think I see what the problem is. We are adding xerces as an implicit dependency to the .war deployment https://github.com/jbossas/jboss-as/blob/master/web/src/main/java/org/jboss/as/web/deployment/WarClassloadingDependencyProcessor.java#L84. This is resulting in one class being loaded from the xerces module and the other being loaded from the xerces jar in .ear/lib, leading to the typical ClassCastException. We are discussing this over IRC on why we add that dependency implicitly.
-
6. Re: xerces class cast exception
prasad.deshpande Jul 6, 2011 3:05 PM (in response to jaikiran)Ok, if that's the case, then just out of curiosity, why removing xerces jar from ear/lib throws class not found exception from war then? Try removing xerces jar from ear/lib.
-
7. Re: xerces class cast exception
jaikiran Jul 9, 2011 3:10 AM (in response to prasad.deshpande)The entire xerces issue has now been fixed in AS7 upstream. Give it a try!
-
8. Re: xerces class cast exception
jason.greene Jul 10, 2011 12:58 PM (in response to prasad.deshpande)FYI we had to patch both the JSF impl (mojarra) and the xerces used by the app server to fix this. They both do class loading in ways that break isolation.
The Xerces bundled in a deployment will not need this patch, since the deployment class loader is the TCCL.
-
9. Re: xerces class cast exception
prasad.deshpande Jul 11, 2011 4:43 AM (in response to jason.greene)Thanks a lot Guys, Fix worked for me.