Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tomcat JSP samples error

0 views
Skip to first unread message

Juan Fco. Navarro

unread,
Jan 8, 2003, 12:30:54 PM1/8/03
to
Hi,

I'm a newbie to JSP. I can't see JSP samples that TOmcat installs.
Servlet samples work fine, but when I try to access to the JSP
samples, I always get the error below.

Thank you in advance

Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error

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

type Exception report

message Internal Server Error

description The server encountered an internal error (Internal Server
Error) that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: sun/tools/javac/Main
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:349)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
at java.lang.Thread.run(Unknown Source)


root cause

java.lang.NoClassDefFoundError: sun/tools/javac/Main
at org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java:128)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:271)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.loadJSP(IDEJspServlet.java:434)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.loadIfNecessary(IDEJspServlet.java:148)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.service(IDEJspServlet.java:160)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFile(IDEJspServlet.java:246)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
at java.lang.Thread.run(Unknown Source)

Phil Hanna

unread,
Jan 10, 2003, 11:24:55 PM1/10/03
to

On 8 Jan 2003 09:30:54 -0800, jnav...@jusan.es (Juan Fco. Navarro)
wrote:

>Hi,
>
>I'm a newbie to JSP. I can't see JSP samples that TOmcat installs.
>Servlet samples work fine, but when I try to access to the JSP
>samples, I always get the error below.
>
>Thank you in advance
>
>Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error
>
>--------------------------------------------------------------------------------
>
>type Exception report
>
>message Internal Server Error
>
>description The server encountered an internal error (Internal Server
>Error) that prevented it from fulfilling this request.
>
>exception
>
>javax.servlet.ServletException: sun/tools/javac/Main
> at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:349)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

...


>root cause
>
>java.lang.NoClassDefFoundError: sun/tools/javac/Main
> at org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java:128)


You are getting the error message because the classpath that your
installation of Tomcat is using does not have the tools.jar file in
it.

Advice: Forget NetBeans or any other IDE if you are just learning.
It's twice as much to learn (Java + IDE) and makes it nearly
impossible for you to figure out problems when they happen. You
probably have your NetBeans setup pointing to a JRE rather than JDK or
something - who knows? My point is, why make it complicated for
yourself?

All you really need is this:

1. Download the JDK directly from java.sun.com and install it with all
the default options.

2. Set your JAVA_HOME environment variable globally to the top level
installation directory (c:\j2sdk1.4.1_01 or whatever you specified)

3. Download Tomcat directly from jakarta.apache.com and install it
with all the default options. The samples should work.

4. Use a simple text editor to write your own test JSP's. Put them in
the default tomcat/webapps/ROOT folder to make it easy. Then just
invoke them with http://localhost:8080/mytest.jsp

Believe me, NetBeans is not saving you any work here. It's holding you
back from learning JSP. It's like driving an automobile blindfolded.
There is plenty of time later to start using an IDE when you feel you
understand Java better and you find out you really need an IDE.

--
Phil Hanna
Author of JSP 2.0: The Complete Reference
http://www.amazon.com/exec/obidos/ASIN/0072224371

Eqbal Z

unread,
Jan 21, 2003, 9:58:30 PM1/21/03
to
I am getting the same error and I did exactly as you said. I installed
the j2sdk in my second hard drive (could that be a problem), set the
JAVA_HOME environment variable, set CATALINA_HOME and then ran the jsp
samples and got the error. I don't get any error with servlet samples.

My org.apache.catalina.jsp_classpath doesn't show tools.jar path in
it. But how do I get Tomcat to read my JAVA_HOME?

Thanks

peh...@yahoo.com (Phil Hanna) wrote in message news:<3e1f9898...@news.ipass.net>...

0 new messages