This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Jasper Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Jasper Exception " Watch "Jasper Exception " New topic
Author

Jasper Exception

Rajesh Vijaya
Ranch Hand

Joined: Oct 18, 2005
Posts: 48
Hi ,
I'm trying to execute the small MVC application but it gives the following error...although my classpath settings are fine

my settings are :

JAVA_HOME(System Varaible):c:\j2sdk1.4.2_09
classpath(user variable):c:\j2sdk1.4.2_09\jre\lib\rt.jar;.;C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.jar
Path(System variable):%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\j2sdk1.4.2_09\bin;C:\Program Files\QuickTime\QTSystem\
TOMCAT_HOME(System Variable):C:\Program Files\Apache Software Foundation\Tomcat 5.0


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:33)
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:33)
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

[ October 25, 2005: Message edited by: Ghanta Rajesh ]
[ October 25, 2005: Message edited by: Mark Spritzler ]

Rajesh <br /> <br />SCJP1.4 SCWCD1.4 SCBCD 1.3 ,SCDJWS(Preparing..)<br /> <br />There is no free will.It is the phenomenon bound by cause and effect.But there is something behind will which is free---Swami Vivekananda...
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Please change the title, its not a MVC question.

Well, you can check the example applications of Tomcat, which come bundled with it. Are they running or not?
James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
i think tomcat 5 requires java 1.5. but from you output it looks like it is trying to use 1.4.

correct me if i wrong ranchers.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

No, you are right. Here it is in big red letters.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Nice catch. It runs fine in 1.4 if you apply the compatibility patch (and yes, a descriptive title would have helped)
Rajesh Vijaya
Ranch Hand

Joined: Oct 18, 2005
Posts: 48
hi Guys ,
Thanks for the replies and sorry about the title...i had this problem while working out a MVC example....well the version of TOMCAT i'm using is Tomcat 5.0.28 but the docs say that Tomcat 5.5 requires JRE 5.0 ....so i'm confused ...any help in this regard is greatly appreciated...


Thanks

Rajesh
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
perhaps you could just download the latest version of the JDK and the JRE? Uninstall then install the new ones... Don't forget to backup your important files(if you do have)...


SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Plus, your question isn't about Servlets. This is a Servlets forum, so try to keep your posts on topic.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Rajesh Vijaya
Ranch Hand

Joined: Oct 18, 2005
Posts: 48
Hi Sam,
Thanks for the advise that works....i downloaded the latest version of JDK and and the latest version of TOMCAT 5.5.12

thanks

Rajesh
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Tomcat 5.5 requires JDK 1.5. But, Tomcat 5.028 does not. I am using it with JDK 1.4 without any problems.

Here


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jasper Exception
 
Similar Threads
JSP Beginner Question
Please help me solving this error
MVC question
Beginner to JSP problem
HTTP 500 error when compiling JSP