I got an error when I tried to compile the project(jsp,java) in Eclipse.
can anyone shed any light on this? thanks.
This is the error message:
Aug 22, 2006 4:00:38 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: -1 in the jsp file: null
C:\Documents and Settings\jbrad\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\PTest\jvindex_jsp.java:8: cannot access java.lang.Object bad class file: C:\Program Files\Java\jre1.5.0_08\lib\rt.jar(java/lang/Object.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. public class jvindex_jsp extends HttpJspBase { ^ 1 error
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:120) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:313) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:324) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source)
Jeroen T Wenting
Ranch Hand
Joined: Apr 21, 2006
Posts: 1847
posted
0
you got your compiler and runtime versions mixed up. This question has been asked on every Java forum I know of at least once a week for the last 2 years or so.
Trying to load a 1.5 classfile (in this case the JRE itself) with a 1.4 runtime isn't going to work.
suggests that you are mixing different versions of Java - versions 1.4 and 1.5. Make sure that you are running Tomcat on Java 1.5 and that it uses JDK 1.5 to compile the JSP's. Right now, it looks like Tomcat is using JDK 1.4 to compile the JSP's.
Which version of Tomcat are you using? I think the newest versions of Tomcat require Java 1.5 (check the Tomcat documentation), are you trying to run it on Java 1.4?
Have a look at the Tomcat logfiles. Maybe it's telling you more about what JDK Tomcat is picking up. And carefully examine your system again, because you do have another JDK than Sun JDK 1.5 installed somewhere. Do you have an IBM JDK or Oracle software, or BEA WebLogic or some other piece of software installed that has its own JDK somewhere? Does the Sun appserver stuff have its own JDK?
It's really impossible that you get the class version error if JDK 1.5 is the only JDK that's on your system.
As a last resort, try removing and re-installing JDK 1.5. Although unlikely, maybe something has gotten corrupt in your JDK. [ August 24, 2006: Message edited by: Jesper Young ]
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.