Wednesday, July 30, 2008

JSF 1.1 and JDK 6

Today I tried to run an application developed with JSF 1.1 on Tomcat 6 running over JDK 1.6.
When I started the application, I got the following exception:

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

After a short search in the Web, I found this thread on java.net foruns:

http://forums.java.net/jive/thread.jspa?threadID=15823

The proposed solution was put a -D argument on Java startup, as follows:

-Dsun.lang.ClassLoader.allowArraySyntax=true

If you're running your application on Eclipse, open "Run -> Open Run Dialog", and in the
Arguments tab of Apache Tomcat (or any other app server that you use), put the above parameter
in the field VM Arguments. The image below shows the configured Open Run Dialog:

No comments: