wood burning stoves*
The moose likes Tomcat and the fly likes JSP Beginner Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "JSP Beginner Question" Watch "JSP Beginner Question" New topic
Author

JSP Beginner Question

Steve Janvrin
Greenhorn

Joined: Feb 10, 2005
Posts: 9
I'm attempting to run the program from chapter 3 of Head First Servlets & JSP, and I get the following error. My environment variables are set to:

Classpath = C:\j2SDK1.4.2_07\bin;C:\j2SDK1.4.2_07\lib\tools.jar;C:\MyProjects\beerV1\src;C:\Tomcat\common\lib\servlet-api.jar

Java Home = C:\j2sdk1.4.2_07

Catalina Home = C:\Tomcat

Tomcat Home = C:\Tomcat

Any assistance is greatly appreciated.

Steve.

*********output follows********

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)
com.example.web.BeerSelect.doPost(BeerSelect.java:24)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
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)
com.example.web.BeerSelect.doPost(BeerSelect.java:24)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
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.


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

Apache Tomcat/5.0.28
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

This thread would probably do better in the Tomcat forum..

When you installed Tomcat, it probably found the wrong installation of Java on your machine. Try uninstalling and installing it again. During the installation, make sure that it finds the full JDK (not just a JRE)
C:\j2SDK1.4.2_07.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Poobhathy Kannan
Ranch Hand

Joined: May 26, 2004
Posts: 94
Seems ,you have added C:\j2SDK1.4.2_07\bin to CLASSPATH .add it to Path variable.


http://learnertobeginner.blogspot.com/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Beginner Question