Hello everyone, I am running Tomcat version 5.0.25 on a Redhat linux platform with jdk v.1.4.2. I have been having all sorts of problems trying to setup a web application, so I started from the very basics. I created a jsp file (with no java code/jsp tags )in the webapps/ROOT directory, and tried to access it over the web ( localhost:8080/test.jsp ) and I get this error:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: -1 in the jsp file: null
However, I am able to access all the example jsps and servlets over the web. I think that this is because the examples are precompiled and premapped in the corresponding web.xml files. Please how can I resolve this issue? Thanks.
do you have JAVA_HOME set (and exported)? is the jdk really a jdk, and not just a jre ?
Joined: Feb 16, 2004
Yes, I am using jdk 1.4.2 and I have the JAVA_HOME variable set to the right path. I am able to access the precompiled jsps,just not able to compile new ones. From the error message, it seems that the compiler is being accessed but something is syntactically wrong with the srcfile for the jsp file.
this may be a CLASSPATH issue. Tomcat 5.0 expects to use the javax.servlet.jsp.PageContext class from a jar called servlet-api.jar in the /common/lib folder. This class includes a handlePageException(t) method that takes a throwable, which is the way Tomcat 5.0 generates the java code from the jsp page. Older jars from other sources include a javax.servlet.jsp.PageContext class that only has a handlePageException(e) mthod that takes an exception - this used to be the way Tomcat created the java code.
Your error appears to be that Tomcat 5.0 is generating java code that expects the handlePageException(t) method, but an older jar is in the way with a javax.servlet.jsp.PageContext class that only has the handlePageException(e) method.
Check the CLASSPATH and make sure the runtime CLASSPATH does not include the older javax.servlet.jsp.PageContext class, you may be including this in the CLASSPATH with your application.