File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Beginner to JSP problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Beginner to JSP problem" Watch "Beginner to JSP problem" New topic
Author

Beginner to JSP problem

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
Mudi Appu
Ranch Hand

Joined: Apr 06, 2005
Posts: 44
correct syntax of setting java home is

folowing is wrong

[ April 18, 2005: Message edited by: kanishtha Kramalekhakha ]

SCJP 2
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
Just to add on, you should have an underscore to join the two words with all letters in uppercase.

So it should be: JAVA_HOME, TOMCAT_HOME, CATALINA_HOME, ANT_HOME, CLASSPATH, PATH, etc.
[ April 19, 2005: Message edited by: Chengwei Lee ]

SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
Dale Seng
Ranch Hand

Joined: Mar 22, 2004
Posts: 275
You might consider in the future posting to the JSP Certification forum because down there, they are REAL into the contents of your book.

--Dale--
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Beginner to JSP problem
 
Similar Threads
Please help me solving this error
JSP Beginner Question
HTTP 500 error when compiling JSP
environmental variable issue
Jasper Exception