You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Matthias Adam <it...@gmx.net> on 2006/09/28 09:44:51 UTC

wrong version 49.0, should be 48.0 - tried everything

Hi everybody,

I already read all kinds of threads about this topic, but I still get from Tomcat the error posted below (basically: "class file has wrong version 49.0, should be 48.0").

I did everything someone ever posted to solve the problem, namely the following:

- My PATH variable, as well as JAVA_HOME, CATALINA_HOME, and TOMCAT_HOME are all set properly (Java 1.5.0_08 path, Tomcat path)
- In Eclipse I did all necessary adjustments:
-> Ant->Runtime is set on Java 1.5/lib/tools.jar
-> Java->Installed JREs is set on jdk1.5.0_08
-> Tomcat is on version 5.x (I use 5.5.17) and the path is set correctly
-> Tomcat->JVM Preferences is on jdk1.5.0_08

I made the following changes to the web.xml in the TOMCAT_HOME\conf\web.xml:
<init-param>
<param-name>compilerTargetVM</param-name>
<param-value>1.5</param-value>
</init-param>
<init-param>
<param-name>compilerSourceVM</param-name>
<param-value>1.5</param-value>
</init-param>
... and I took the comment brackets out in the "invoker" entries (I guess I have to do that in order to use the tomcatplugin in eclipse)

I tried the same things on more PCs, some of them don't have and never had an older Java version than Java 1.5. Still the same error message. What else could cause the problem, what else should I do?

I start the Tomcat server in Eclipse, and when I start the browser and go on the tomcat site (http://localhost:8082/) the error comes. If I look at "http://localhost:8082/manager/status", under JVM Version it is says: 1.5.0_08-b03. I compiled the .java files of my project with Java 1.5. So how can it be???

Pleas help me, I'm desperate by now!!!

Here the Tomcat error message:
--------------------------------------------------------
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

Generated servlet error:
[javac] Compiling 1 source file

D:\user\Eclipse\workspace\myApp\work\index_jsp.java:9: cannot access myPackage.Const
bad class file: D:\user\Eclipse\workspace\myApp\myPackage\Const.class
class file has wrong version 49.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
import myPackage.Const;
                 ^
1 error
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
Apache Tomcat/5.5.17
--------------------------------------------------------

P.S. A java -version in the console outputs the following:
java version "1.5.0_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)
Java HotSpot(TM) Client VM (build 1.5.0_08-b03, mixed mode, sharing)
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: wrong version 49.0, should be 48.0 - tried everything

Posted by Matthias Adam <it...@gmx.net>.
Fortunately I solved my problem. What I had overseen is that there was in my project sturcture an old "tools.jar" file, which was made for Java 1.4. Deleting this file finally made Tomcat compile the files.

Thanx anyway!

-------- Original-Nachricht --------
Datum: Thu, 28 Sep 2006 07:40:54 -0500
Von: "Caldarale, Charles R" <Ch...@unisys.com>
An: "Tomcat Users List" <us...@tomcat.apache.org>
Betreff: RE: wrong version 49.0, should be 48.0 - tried everything

> > From: Matthias Adam [mailto:its.magic4u@gmx.net] 
> > Subject: wrong version 49.0, should be 48.0 - tried everything
> > 
> > I already read all kinds of threads about this topic, but I 
> > still get from Tomcat the error posted below (basically: 
> > "class file has wrong version 49.0, should be 48.0").
> 
> This is not a message coming out of the JVM classloader.  Just
> speculating here, but it looks like your JSP is dependent on some class
> compiled as 1.5, and this version of Jasper can't handle it.  You might
> try recompiling your library classes with -target 1.4 (assuming you're
> not using 1.5 syntax).
> 
> I've not heard of Eclipse requiring the invoker servlet (really
> unfortunate if it does), but then I don't use Eclipse.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: wrong version 49.0, should be 48.0 - tried everything

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Matthias Adam [mailto:its.magic4u@gmx.net] 
> Subject: wrong version 49.0, should be 48.0 - tried everything
> 
> I already read all kinds of threads about this topic, but I 
> still get from Tomcat the error posted below (basically: 
> "class file has wrong version 49.0, should be 48.0").

This is not a message coming out of the JVM classloader.  Just
speculating here, but it looks like your JSP is dependent on some class
compiled as 1.5, and this version of Jasper can't handle it.  You might
try recompiling your library classes with -target 1.4 (assuming you're
not using 1.5 syntax).

I've not heard of Eclipse requiring the invoker servlet (really
unfortunate if it does), but then I don't use Eclipse.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org