javax.faces.FacesException: java.lang.ClassNotFoundException: [Ljava.lang.String; – Mea Cup O' Jo
Skip to content


javax.faces.FacesException: java.lang.ClassNotFoundException: [Ljava.lang.String;

I was trying to deploy pre-packaged WAR application into Tomcat 6 when I run into the following (partial) stacktrace

java.lang.ClassNotFoundException: [Ljava.lang.String;
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
	at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:635)
	at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:422)
	at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:348)

Turned out - since I'm using jdk1.6 unlike 1.5 it will not attempt to load class (java.lang.String) by name by default, hence the exception.Since I'm running this from within Eclipse 3.4 - WTP it is easily solvable by locating JVM runtime in Eclipse's preferences (Window->Preferences->Installed JREs), highlighting the entry and adding runtime parameter -Dsun.lang.ClassLoader.allowArraySyntax=true

Add JVM runtime options

Add JVM runtime options


Save it and run your project, you should not see this problem anymore. If you are running straight Tomcat then add the same runtime option into Catalina.sh (Catalina.bat on Windows)

Posted in Java, Web stuff.


8 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Henriquerr says

    tks tks tks!
    You help me a lot! =)

  2. Sandeep says

    Thank you very much for your help

  3. Tester says

    This DOESN'T work. I tried it but it doesn't work.

    • droidin says

      I feel your pain! Try solution below comment from Peter

  4. Peter Jackson says

    It's better if you put this value in JAVA_OPTS. If you compile in the console then it also works. Your solution it only works in eclipse.

    • droidin says

      Well – I think the tip was originally intended for Eclipse but I see your point, thanks!

  5. pilar says

    GRacias!!!



Some HTML is OK

or, reply to this post via trackback.