-
Tomcat 5
I have an JSP, when I run this, I'll get this message (I am 100% sure that the code is ok):
Code:
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
C:\Tomcat 5.0\work\Catalina\localhost\jsp-examples\org\apache\jsp\MyFirstJSP_jsp.java:8: cannot access java.lang.Object
bad class file: C:\Program Files\Java\j2re1.4.2_04\lib\rt.jar(java/lang/Object.class)
class file has wrong version 48.0, should be 47.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
implements org.apache.jasper.runtime.JspSourceDependent {
^
1 error
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:83)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:315)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:406)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:463)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:442)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:430)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.25 logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.0.25
What is wrong with the rt.jar file?
-
I recommend you reinstall the Java SDK and Tomcat. Something seems to be very wrong.
-
-
Now reinstalled I've made a new folder named test in the webapps folder including a file named test.jsp. When try to run this by http://localhost:8082/Test/test.jsp an error occurs saying:
Code:
HTTP Status 404 - /Test/MyFirstJSP.jsp
--------------------------------------------------------------------------------
type Status report
message /Test/MyFirstJSP.jsp
description The requested resource (/Test/MyFirstJSP.jsp) is not available.
--------------------------------------------------------------------------------
Apache Tomcat/5.0.25
The strange thing is, that if I run the examples e.g http://localhost:8082/jsp-examples/j...arithmetic.jsp I have no problems running this?????
-
Is the capitalization exactly the same? Out of interest, are you running this on Linux or Windows?
-
Sorry, posted the wrong link, of course it's http://localhost:8082/Test/MyFirstJSP.jsp.
I am using Win2000 by the way
-
Hmmm... I always had problems configuring Tomcat, and it's definitely a configuration problem. The only time I got it to work is the one now running on my Linux server...
Hmmm...
Can you upload your server.xml (I believe there is no sensitive info inside) and outline your directory structure?