Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What the hell is THIS?!

 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Brian Glodde
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doublecheck servlet.jar! That would be my 1st course of action.
 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So Tomcat isn't really loading the JARs found under JAVA_HOME? It's using its own in some cases?!?
 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wouldnt this be the case because your path variable may contain a "." before the JAVA_HOME?
 
Ian Scott
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

Any ideas?
Thanks
Ian
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sajan Mathew
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic