Solved

Error Loading JSP!

Posted on 2004-09-12
6
230 Views
Last Modified: 2010-04-01
Hi experts,

i just have my tomcat 5.0.2.7 setup on windows 2000 SP4 station. However, no matter what jsp file i run, the browser returns following error.

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.27 logs.

Is that anything wrong with my config?

Please help.

Thank you very much,

Goran
0
Comment
Question by:goranwong
6 Comments
 
LVL 92

Accepted Solution

by:
objects earned 34 total points
Comment Utility
you also need the JDK installed
0
 

Assisted Solution

by:kheefatt
kheefatt earned 33 total points
Comment Utility
When j2sdk is installed, u need to set the environment variables for it. I think windows 2000 and windows xp is almost the same. Go to settings > control panel > system. Goto Advanced tab and u should see environment variables button there. Under system variables, click new and insert the details. Under variable name, put JAVA_HOME. Under variable value, put your jdk path (for example I put it as C:\Program Files\j2sdk1.4.2_04).
0
 
LVL 9

Assisted Solution

by:ronan_40060
ronan_40060 earned 33 total points
Comment Utility
Hi There goran

Well like Objects mentioned JDK is the first thing you shud download and install
The only small doubt I have is whether J2SE 1.4 version is compatible with Tomcat 5 and on ?? else we cud have J2SE 1.5 with Tomcat 5
For the deployment of Tomcat on various plateform
Please do NOT forget to go through the following links ; all explained :)
http://www.cnr.berkeley.edu/~salazar/apache_tomcat.html
http://www.onjava.com/pub/a/onjava/2002/11/20/tomcat.html
http://www.devside.net/web/server/windows/Tomcat
http://www.connecties.com/cymulacrum/tomcat5/book1.html

------------------------------------------------------------------------------------------------------------------------------------
After you install Tomcat
For the Deployment of JSPs

a>Copy your WAR file to the TOMCAT_HOME/webapps directory.

b>Add a new Context entry to the TOMCAT_HOME/conf/server.xml file, setting the values for the path and docBase to the name of your web application.

c>Restart Tomcat after completing these steps. .

on the browser

http://localhost/urapp/

 Few notes
IN  TOMCAT_HOME/webapps directory, you will see a new directory matching the name of your WAR file. This is where your working web application now exists. When Tomcat starts it will extract all WAR files that have been recently placed into the TOMCAT_HOME/webapps directory.
 web.xml and  jsp will be inside the war file.

for JSPs
a>You need to  create a folder name for example myapp in the webapps folder, place your jsp there  i.e <tomcat dir>/webapps/myapp
and restart tomcat and try
http://localhost:8080/myapp/Hello1.jsp

Let us know How it goes

Good Luck
Ronan

0
 
LVL 2

Expert Comment

by:arnon81
Comment Utility
Hi Goran,
this is what I do in my computer
c:\tomcat 5.0.2.7>set JAVA_HOME=C:\j2sdk1.4.1_01  
c:\tomcat 5.0.2.7>cd bin
and then run tomcat


0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In this step by step tutorial with screenshots, we will show you HOW TO: Enable SSH Remote Access on a VMware vSphere Hypervisor 6.5 (ESXi 6.5). This is important if you need to enable SSH remote access for additional troubleshooting of the ESXi hos…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now