Hey folks, I'm running an easy servlet with getRequestDispatcher delivering a session into a jsp file. I have WinXP, jsk1.4 & jdkee1.3.1. Everything works fine on tomcat 3.0. But on tomcat 4.0.3 i get a brain-kicking-crazy-no-way-to-deal-with exception: -------------------- org.apache.jasper.JasperException: Unable to compile class for JSPerror: Invalid class file format in D:\JAVA\j2sdk1.4.0\jre\lib\rt.jar(java/lang/Object.class). The major.minor version '48.0' is too recent for this tool to understand. D:\JAVA\J2EE\jakarta-tomcat-4.0\work\localhost\_\html-docs\jsp\deliverjsp$jsp.java:0: Class java.lang.Object not found in class javax.servlet.GenericServlet. package org.apache.jsp; ----------- What the hell is this? java.lang.Object not found? The major.minor version is too recent? Everythink is compiled and running on another version of tomcat! What does all this abracadabra mean? ThanXX
Asher Tarnopolski
SCJP,SCWCD
Brian Glodde
Ranch Hand
Joined: Jun 27, 2001
Posts: 171
posted
0
Make sure that you are really running Tomcat with references to only JDK 1.4. This error message is only generated by older JVMs when presented with newer JAR files (i.e. a 1.3 JVM trying to read a 1.4 JAR file). Hope that helps!
Asher Tarnopolski
Ranch Hand
Joined: Jul 28, 2001
Posts: 260
posted
0
Thank's for reply. I guessed that there is some kind of error in JVM. I had tomcat 3.3 on the same machine earlier, and an older JVM, but i removed them. The JAVA_HOME and co. variables are set to the new jdk 4.0 path. Same about the tomcat. Were should I look for the "old" files?
Brian Glodde
Ranch Hand
Joined: Jun 27, 2001
Posts: 171
posted
0
Doublecheck servlet.jar! That would be my 1st course of action.
Asher Tarnopolski
Ranch Hand
Joined: Jul 28, 2001
Posts: 260
posted
0
I've found the solution. I've copied the tools.jar file from jdk4.0 into tomcat. there is a tools.jar file also in one of the tomcat's directories, but it was much older (version of 2001). Since this change everything is working right. So, in case you will have such problems...
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
So Tomcat isn't really loading the JARs found under JAVA_HOME? It's using its own in some cases?!?
Asher Tarnopolski
Ranch Hand
Joined: Jul 28, 2001
Posts: 260
posted
0
well, if tomcat would use only jar files from JAVA_HOME , there would be no files with the same name/extention in tomcat's package.... looks strange for me too
ethan winograd
Greenhorn
Joined: Mar 20, 2001
Posts: 7
posted
0
Wouldnt this be the case because your path variable may contain a "." before the JAVA_HOME?
Ian Scott
Greenhorn
Joined: Apr 23, 2003
Posts: 1
posted
0
Hmm. I've got the same problem on a Sun box. I can't find tools.jar in the tomcat directory. I'm using jakarta-tomcat-4.0.6-LE-jdk14 (i.e. the special 1.4 version, and JDK 1.4.1
If you install tomcat using the .exe version, the installer will copy 'tools.jar' inside tomcat - but if you are using tomcat from a .zip or .tar.gz then tomcat uses the 'tools.jar' from JAVA_HOME Rene
I had a similar issue and I copied the tools.jar file from jdk4.0 into tomcat tools.jar. Thanks Asher. You saved the day.
Rahul Ravinder Budhiraja
Greenhorn
Joined: Jan 05, 2005
Posts: 3
posted
0
Hi Friends , I am facing same problem on a Sun box.Since i have installed tomcat4.0.6 using the .zip the tomcat uses the 'tools.jar' from JAVA_HOME , so I copied the tools.jar file from jdk1.4 into tomcat4.0.6 but still i am facing the same error
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
/tomcat/jakarta-tomcat-4.0.6/work/Standalone/localhost/vacation/includes/adminTop1$jsp.java:4: Class or interface declaration expected. import javax.servlet.*; ^
/tomcat/jakarta-tomcat-4.0.6/work/Standalone/localhost/vacation/includes/adminTop1$jsp.java:10: Superclass org.apache.jsp.HttpJspBase of class org.apache.jsp.adminTop1$jsp not found. public class adminTop1$jsp extends HttpJspBase {
Any clues where am I going wrong
Thanks Rahul
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.