Tomcat won't compile JSP

S

sciolist

I've installed my Java libraries, and I am successfully able to compile
and run Jave files from the command line. However, when I attempt to
load a JSP file from my Apache Tomcat server I get the error below.

Does Tomcat have any unique references to the JRE, such that I need to
specify its location in Tomcat?

Thanks in advance.

---------------------------------------------------------------------------------------------------------------------------

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
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:346)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:414)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
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:802)


root cause

Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:106)
org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:935)
org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
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:802)


note The full stack trace of the root cause is available in the Apache
Tomcat/5.0.28 logs.
 
S

steen

I've installed my Java libraries, and I am successfully able to compile
and run Jave files from the command line. However, when I attempt to
load a JSP file from my Apache Tomcat server I get the error below.

Does Tomcat have any unique references to the JRE, such that I need to
specify its location in Tomcat?

Thanks in advance.

---------------------------------------------------------------------------------------------------------------------------

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
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:346)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:414)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
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:802)


root cause

Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:106)
org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:935)
org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
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:802)


note The full stack trace of the root cause is available in the Apache
Tomcat/5.0.28 logs.

Just out of curiosity, is JAVA_HOME set ?
"Perhaps JAVA_HOME does not point to the JDK"

/Steen
 
S

sciolist

We've discovered that the path locations that we found on the net were
not correct... It works now!

Here are our paths:

CLASSPATH: C:\j2sdk1.4.2_12\bin\;C:\WINDOWS\system32\QTJava.zip
JAVA_HOME: C:\j2sdk1.4.2_12\
QTJAVA: "C:\WINDOWS\system32\QTJava.zip"

After updating the paths we uninstalled and reinstalled Tomcat.
Apparently Tomcat was not dynamically checking for changes in the path
locations and required a fresh install.
 
J

Jeff Kish

We've discovered that the path locations that we found on the net were
not correct... It works now!

Here are our paths:

CLASSPATH: C:\j2sdk1.4.2_12\bin\;C:\WINDOWS\system32\QTJava.zip
JAVA_HOME: C:\j2sdk1.4.2_12\
QTJAVA: "C:\WINDOWS\system32\QTJava.zip"

After updating the paths we uninstalled and reinstalled Tomcat.
Apparently Tomcat was not dynamically checking for changes in the path
locations and required a fresh install.
<snip>
Just a newbie here, but that just doesn't sound correct. I'm sure the java
location is 'dynamic' and just requires setting of an environmental pointer or
two, or possibly update of some .xml file along with stopping and starting the
Tomcat service (if it is a service).

glad its working though.

Can someone tell me if I'm right or wrong?
Jeff Kish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,829
Messages
2,569,737
Members
45,525
Latest member
RosalindSa

Latest Threads

Top