[
http://jira.jboss.com/jira/browse/JBAS-4927?page=comments#action_12389215 ]
Stefan Guilhen commented on JBAS-4927:
--------------------------------------
I've applied a fix to WebAppClassLoader's findClass(String name) method. This
method now first tries to get the class by calling super.findClass(name). Only when this
fails a dynamic stub generation is attempted. So, when the stub classes are packaged in
the war file, the super.findClass(name) call will locate the classes and no dynamic stub
will be generated.
The NoClassDefFoundError that Greg reports happens because the dynamic stub generation
capabilities of WebAppClassLoader introduce a dependency on the IIOP module
(IIOPStubCompiler). Applications running in the default partition will get a
NoClassDefFoundError when the compiler is invoked because the jboss-iiop.jar is not
available in the defult/lib directory. So, although the fix I've added solves the
problem when the application has the stubs class packaged in the war file, applications
that really need the dynamic stub generation in the default partition will get this NCDFE
unless the jboss-iiop.jar is copied to defaul/lib.
Code added in 4.2.1 breaks web app that works in 4.2.0
------------------------------------------------------
Key: JBAS-4927
URL:
http://jira.jboss.com/jira/browse/JBAS-4927
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Web (Tomcat) service
Affects Versions: JBossAS-4.2.1.GA, JBossAS-4.2.2.GA
Environment: linux, java5
Reporter: Greg Bridges
Assigned To: Stefan Guilhen
Fix For: JBossAS-4.2.3.GA
Code was added in version 4.2.1 to the WebAppClassLoader class to override the
findClass() operation.
I have a web app that uses the sun rmi-iiop to connect to remote applications (which
worked fine before). The stubs for my code are located in my deployed jars in the war.
At line 98 in WebAppClassLoader.java, a call is made to attempt to run the
iiopstubcompiler. It gets a ClassDefNotFound on the IIOPStubCompiler class, which then
bypasses the catch block (which is looking for a RuntimeException). It looks like the
intent was to run the super.findClass() if there is any trouble, but that doesn't
happen due to the catch block being bypassed.
If I change the code to catch Throwable or add a catch for ClassDefNotFound which runs
super.findClass(), the app works as it did before.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira