HTTP Status 500 -

HTTP Status 500 -

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.

TTP 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.jav acError(DefaultErrorHandler.java:97) org.apache.jasper.compiler.ErrorDispatcher.javacEr ror(ErrorDispatcher.java:346) org.apache.jasper.compiler.Compiler.generateClass( Compiler.java:414) org.apache.jasper.compiler.Compiler.compile(Compil er.java:472) org.apache.jasper.compiler.Compiler.compile(Compil er.java:451) org.apache.jasper.compiler.Compiler.compile(Compil er.java:439) org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:511) org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:295) org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.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.CompilerAd apterFactory.getCompiler(CompilerAdapterFactory.ja va: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(Compil er.java:472) org.apache.jasper.compiler.Compiler.compile(Compil er.java:451) org.apache.jasper.compiler.Compiler.compile(Compil er.java:439) org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:511) org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:295) org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.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.

Apache Tomcat/5.0.28

plz solution for the above problem

Thanks & regards sree

View Answers

February 12, 2011 at 3:44 PM

It seems that there is a programming error. Anyways, first of all check the following steps:

1)Go to the Control Panel>>System>>Environment Variable And the set the variable CATALINA_HOME and put the path of your apache tomcat as a value like: C:\apache-tomcat-5.5.

2)Like that create another variable classpath and put the path of apache-tomcat lib as a value like C:\apache-tomcat-5.5\lib.*;

3)Also put the servlet api.jar file inside the lib folder.

4)Now create a jsp file:'hello.jsp'

<%@page language="java"%>
<%String st="Hello World";
%>
Message is <%=st%>

5)Put this jsp file inside the apache-tomcat>>webapps>>web application folder>>

6)You have to give appropriate name to web application folder like examples and put jsp file into it.

7)Then start the tomcat server by clicking startup.bat from the bin folder of your tomcat.

8)Open your browser and type the following url:

http://localhost:8080/examples/hello.jsp and press enter.

9)You jsp program will then display the output on the browser.

Post your code.









Related Tutorials/Questions & Answers:

Ads