Bug 46961

Summary: org.apache.catalina.loader.WebappClassLoader throws exception related to Java 6 Bug 6434149
Product: Tomcat 5 Reporter: Eduardo Torres-Pardo <eduardo.torres-pardo>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 5.5.27   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description Eduardo Torres-Pardo 2009-04-03 07:15:39 UTC
Our application uses JSF. Upon defining navigation with NavigationRuleRule, we get the exception

WARN  NavigationRuleRule - [NavigationRuleRule]{faces-config/navigation-rule} Me

rge(*)

java.lang.ClassNotFoundException: [Ljava.lang.String;

        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa

der.java:1352)

        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa

der.java:1198)

        at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.ja

va:615)

        at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.ja

va:402)

        at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureLi

stener.java:328)

        at org.apache.catalina.core.StandardContext.listenerStart(StandardContex

t.java:3729)

        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4

187)

        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)

 

        at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)

        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)

 

        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442

)

        at org.apache.catalina.startup.Embedded.start(Embedded.java:821)


This is due to Java 6 Bug 6434149 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6434149)

This link recommends the following actions to solve this bug:

1) Add -Dsun.lang.ClassLoader.allowArraySyntax=true if you want to use a library for which you don't have the source with JDK6

2) Change loader.loadClass( name ) to Class.forName( name, false, loader ) if you own the code.

class org.apache.catalina.loader.WebAppClassLoader 
uses this code to load classes:

clazz = loader.loadClass(name);

Can you please change the sections of code where this line is used (1352 and others) to
clazz =  Class.forName( name, false, loader);

so this problem is solved?

Thanks
Comment 1 Mark Thomas 2009-04-09 05:55:57 UTC
I've fixed this in trunk but won't be proposing it for backport to 6.0.x or 5.5.x. For those versions you can use setenv.sh|bat to configure -Dsun.lang.ClassLoader.allowArraySyntax=true