https://issues.apache.org/bugzilla/show_bug.cgi?id=48489
Summary: Tomcat CL doesn't resolve the array classes.
Product: Tomcat 6
Version: 6.0.0
Platform: All
OS/Version: Linux
Status: NEW
Severity: major
Priority: P2
Component: Catalina
AssignedTo: [email protected]
ReportedBy: [email protected]
Attached is the sample app whose index.jsp would explain the error, call this
jsp
http://localhost:8080/sampleapp/index.jsp
The TomcatCL does not resolve the array class e.g
loader.loadClass("[Lsample.SampleClass;")
And here is the fix
Index: src/share/classes/org/apache/catalina/loader/WebappClassLoader.java
===================================================================
--- src/share/classes/org/apache/catalina/loader/WebappClassLoader.java
(revision 1335)
+++ src/share/classes/org/apache/catalina/loader/WebappClassLoader.java
(working copy)
@@ -902,8 +902,22 @@
throw new ClassNotFoundException(name);
}
} catch (ClassNotFoundException e) {
- if (log.isTraceEnabled())
- log.trace(" --> Passing on ClassNotFoundException");
+ if (log.isTraceEnabled())
+ log.trace("We need to check for array class "+name);
+ if( name.charAt(0) == '[' )
+ {
+ clazz = Class.forName(name, true, this);
+ if (log.isTraceEnabled())
+ log.debug(" Returning class " + clazz);
+ if ((log.isTraceEnabled()) && (clazz != null))
+ log.debug(" Loaded by " + clazz.getClassLoader());
+ return clazz;
+ }
+ else
+ {
+ if (log.isTraceEnabled())
+ log.trace(" --> Passing on ClassNotFoundException");
+ }
throw e;
}
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]