aspose file tools*
The moose likes Tomcat and the fly likes UnsupportedClassVersionError while startup. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "UnsupportedClassVersionError while startup." Watch "UnsupportedClassVersionError while startup." New topic
Author

UnsupportedClassVersionError while startup.

Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

Hello,

When I try to startup tomcat 6.0.10 using 'startup' fron a Window platform, I am not able to. So when I tried using the 'catalina debug' startup option I get a UnsupportedClassVersionError. Since I was on JDK 1.6 I guessed it could be a compatibility issue between versions. I got JDK 1.5.0_11.

My issue is like I still get the same error. Checking the documentation I found that tomcat 6.0 works with JDK 1.5 Any ideas on how to resolve this?

Thanks,
Rajkamal.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39549
    
  27
For which class is the UnsupportedClassVersionError reported? The stack trace in the log files should say so.


Ping & DNS - updated with new look and Ping home screen widget
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

It's been thrown in the ClassLoader. I also have my CATALINA_HOME and JAVA_HOME pointing to the correct folders.

This is the relevant stack trace part....

============================================================================
run org.apache.catalina.startup.Bootstrap start
>
VM Started:
Exception occurred: java.lang.UnsupportedClassVersionError (uncaught) thread="ma
in", java.lang.ClassLoader.defineClass(), line=732, bci=217

main[1] cont
java.lang.UnsupportedClassVersionError: org/apache/catalina/startup/Bootstrap (U
nsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass(ClassLoader.java:732)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:13
3)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:320)
at java.net.URLClassLoader.access$400(URLClassLoader.java:93)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:678)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:239)
at java.lang.ClassLoader.loadClass(ClassLoader.java:516)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:460)
at java.lang.ClassLoader.loadClass(ClassLoader.java:448)
> Exception in thread "main"

The application exited
============================================================================
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39549
    
  27
Class version 49.0 is the one used by Java 5, so if the JVM complains about that, it must be 1.4 at the most. How are you starting Tomcat, and how do you determine which JRE it uses?
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

Hello Ulf,

I downloaded JRE 1.4.2_14. Uninstalled JRE 1.5 and got the older version installed. Still I get the same error report. When I do a java -version this is what I get :-
===
java version "1.4.2_14"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_14-b05)
Java HotSpot(TM) Client VM (build 1.4.2_14-b05, mixed mode)
===
Shouldn't it be running on the same (currently installed) JRE? Do you think I sould be looking for JRE 1.4.0 or something?

And thanks a ton!!!
Rajkamal.
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

I'm starting tomcat with 'startup' and if it fails I go for the 'catalina debug' so that I get the error/exception report.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
Since I was on JDK 1.6 I guessed it could be a compatibility issue between versions. I got JDK 1.5.0_11.


Personally I compile using JDK 1.6 but with target=1.5 and source=1.5 in order to avoid that unsupported error with Tomcat 5.5.9

Bill


Java Resources at www.wbrogden.com
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

But I'm not trying to deploy any of my applications on Tomcat. All I'm doing is trying to startup the server and thats when I get this error. As far as tomcat installation is concerned I have a binary version downloaded. What I feel is maybe I'm leaving out something?

Could somebody help me on that?

Thanks,
Rajkamal.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39549
    
  27
Do you think I sould be looking for JRE 1.4.0 or something?


No. It was already running on a 1.4 JVM; that's why you got that error. A 1.5 or later JVM wouldn't have this problem.

It's not unheard of to have multiple JREs installed, sometimes without even being aware of it. Alter the startup script so that it definitely uses a 1.5 JRE to run, and see what happens.
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

Thanks Ulf,

On your advice, I checked with the JRE installed on my machine. There were multiple JREs installed on my machine. There was a 1.4 and a 5.0. That must've been the cause, I feel.

I uninstalled the JRE on my box and got JRE 5.0 alone. Then when I tried to get tomcat started it went through well.

The issue has been resolved and thanks a lot for your guidance.

Rajkamal.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: UnsupportedClassVersionError while startup.
 
Similar Threads
UnsupportedClassVersionError
UnsupportedClassVersionError
UnsupportedClassVersionError
UnsupportedClassVersionError
UnsupportedClassVersionError