Solved

Why isnt my Tomcat Serving JSP

Posted on 2002-04-17
10
339 Views
Last Modified: 2010-04-01
Hey There,

Okay this under WindowsXP Professional.

1) Okay I have installed J2SE 1.4 from sun.com
2) Set JAVA_HOME env variable to the directory that the above was installed into.
3) Then also downloaded and installed Tomcat 4.0.3. from sun/apache.

If i goto http://localhost:8080/ in Internet Explorer then I get the Tomcat welcome page appear. On the left of the welcome page is a menu containing some links to some examples.

If i Follow the 'Servlets Examples' link and execute a couple of the example servlets they all seem to work fine.

HOWEVER if I follow the 'JSP Examples' link and try executing any of the examples or any other JSP page for that matter I get a HTTP 500 Internal Server Error.

Whats wrong with my Tomcat (its a fresh install) why will it serve servlets but not JSP pages corectly.

Thanks

Adam Retter
Network and Systems Administrator
Project COSMIC
www.cosmic.org.uk
adam@cosmic.org.uk
0
Comment
Question by:adamretter
  • 5
  • 4
10 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 6948357
Is your setup done properly.. like paths etc.

CJ
0
 
LVL 27

Expert Comment

by:rrz
ID: 6949087
What  is the rest of that error message?  
0
 

Author Comment

by:adamretter
ID: 6950382
Okay here is the error page produced when I try and Execute the NumberGuess JSP example:


Apache Tomcat/4.0.3 - 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.apache.jasper.servlet.JspServlet.service(JspServlet.java:485)
      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:190)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
      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:2343)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      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:468)
      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:174)
      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:1012)
      at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
      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:136)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:272)
      at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
      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:190)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
      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:2343)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      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:468)
      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:174)
      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:1012)
      at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
      at java.lang.Thread.run(Unknown Source)

0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6950871
maybe its not finding the libs to compile the JSP...
make sure that JDK path is there and the proper libs are
in the classpath.

CJ
0
 

Author Comment

by:adamretter
ID: 6951039
Where do I find these ?
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 19

Expert Comment

by:cheekycj
ID: 6951079
the JDK path should actually be there.. tomcat won't work at all without it.

You need to include the c:\jdk1.4\lib\tools.jar file in your CLASSPATH...

or copy tools.jar to the tomcat\lib directory.

CJ


0
 

Author Comment

by:adamretter
ID: 6951121
I dont have a tools.jar as far as i can see.

I have installed j2re1.4.0 is that right?
0
 
LVL 19

Accepted Solution

by:
cheekycj earned 100 total points
ID: 6951144
you need JDK not JRE.  Since tomcat needs to compile JSPs into Servlets.. it needs the JDK to do that.  JRE is just for running java programs not compiling them.

I would uninstall the JRE and install JDK 1.4 b/c that comes with JRE too.

CJ
0
 

Author Comment

by:adamretter
ID: 6951686
Seems to have fixed it thanks.

I needed the SDK instead of the JRE - found the sun website a little confusing but got the right one in the end.

Thanks
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6951789
Glad I could help and Thanx for the "A"
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
jquery form plugin 4 152
unit test DAO layer 1 133
sortaSum challenge java 17 171
JavaScript parse form with colon separated values 2 63
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

13 Experts available now in Live!

Get 1:1 Help Now