Thursday, October 30, 2008

java.lang.UnsupportedClassVersionError: oracle/jdbc/driver/OracleDriver (Unsupported major.minor version 49.0)

java.lang.UnsupportedClassVersionError: oracle/jdbc/driver/OracleDriver (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java(Compiled Code))
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java(Compiled Code))
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:446)
at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:396)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:300)
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java(Compiled Code))


Scenario:
The above error occurred when I tried to load the ojdbc5.jar inside WSAD test server i.e When I tried to deploy my application on WSAD test server.As the Test server JVM is JDK 1.4 based it was unable to load the JDK 1.5 compiled ojdbc5.jar.
I am not sure if any plugin for WSAD exists to run it in JDK 1.5.If not we have to use either JDeveloper or RAD etc.,
Speaking in general the above exception occurs when you compiled a JAR/File using JDK X and trying to run or deploy it using JDK Y where Y is less than X.So the obvious solution is to run it on a compatible JDK.


No comments: