I got an error message when running JSF 1.1 with JBoss 4.0.5. I know what you’re thinking, you’re thinking “why the hell this guy is using such an old App Server”. Most of my clients are big corporates and most of big corporates are using only test-proven solutions and frameworks. So one of my clients decided to use JDK 1.4 for a new project. I’m using JBoss 4.0.5 because it’s the last stable version which compiled and runs under JDK 1.4, based on the matrix. Here is the error:

java.lang.UnsupportedClassVersionError: peos (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

It was weird because I was sure I’ve set the runtime environment for JDK 1.4 and made sure that every project settings were OK. After a while I figure out the problem. It’s because JBoss brings its own jars forJSF implementation, the jars made conflicts with the jars library from my project workspace. The JBoss’ jars can be found at

%JBOSS_PATH%/server/%YOUR_SERVER_CONFIGURATION%/deploy/jbossweb-tomcat55.sar/jsf-libs/myfaces-api.jar

and

%JBOSS_PATH%/server/%YOUR_SERVER_CONFIGURATION%/deploy/jbossweb-tomcat55.sar/jsf-libs/myfaces-impl.jar.

Delete both jars, set in the eclipse’s Project Facets for JSF 1.1 and Servlet 2.3, set a new server with a new runtime environment and do a clean to your project, and it should be fine.