org.apache.jasper.JasperException: Unable to compile class for JSP
843834Feb 21 2004 — edited May 6 2009I downloaded jwsdp 1.3 and j2ee 1.4 and installed both of them. Everything starts .. tomcat starts running properly. Runs html and some jsp pages. But when i try running some jsp pages i get the
"org.apache.jasper.JasperException: Unable to compile class for JSP" error. I have looked at all the forums and tried using the replies people have given. the java_home path is set properly to the jdk\bin directory. i have also put the tools.jar file into the common/lib folder of the tomcat server.
i already tried uninstalling and reinstalling both of them. so far i have almost wasted more than 4 days .. yet i keep seeing the following error
org.apache.jasper.JasperException: Unable to compile class for JSP
No Java compiler was found to compile the generated source for the JSP.
This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
If using an alternate Java compiler, please check its installation and access path.
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.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:128)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:348)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:455)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:555)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:300)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
my jsp file is as follows... its nothing fancy ..
<html>
<head>
<% @ page language="java" %>
<title>second jsp page</title>
</head>
<body>
<BR>
<%!
String sitename="jsp.com";
int counter = 0;
private void increment Counter()
{
counter++;
}
%>
Website of the day is
<% =sitename %>
<BR>
page accessed
<% =counter %>
<!-- % ="Hello world" % -->
<!-- % System.out.println("Hello world"); % -->
</body>
</html>
will some one please let me know what the problem is ..