Tomcat Problem

Hi Everbody,

I have installed Tomcat 5.0 with JDK 5.0 . I can view HTML pages but not JSP pages. When I point to a JSP page the page gives the following error

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:434)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:492)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:471)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:459)
      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:105)
      org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:929)
      org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:758)
      org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:402)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:492)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:471)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:459)
      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.29 logs.




I have set Java_Home variable from System->Enviromental Variables to JDK base directory. I also added bin directory to classpath so in every directory I can use Java related commands. But still c an not overcome the problem. What may be going wrong?

Thanks
LVL 4
MacroLandAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kiranhkCommented:
you need to put the JDK home directory in the path variable (dont put the JRE) like
path=C:\jdk1.5.0


probably ur path is pointing to a JRE?? check this out and change it to ur JDK installation
0
MacroLandAuthor Commented:
u mean the path in enviromental variables ?
0
MacroLandAuthor Commented:
my path command is as PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\SI Technologies\ATI Control Panel;C:\Program File\Tools\WinNT;C:\Program Files\Microsoft Visual Sram Files\Microsoft Visual Studio\Common\Tools;C Studio\VC98\bin;C:\Program Files\Java\jdk1.5.0

In Apache Tomcat Properties

JVM Points to C:\Program Files\Java\jre1.5.0\bin\client\jvm.dll
Java Classpath points to C:\Program Files\Java\jre1.5.0\lib\tools.jar;C:\Program Files\Apache Software Foundation\Tomcat 5.0\bin\bootstrap.jar

everything seems fine for me so far, what is wrong? It gives the same error again
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

kiranhkCommented:
try putting
JAVA_HOME=C:\Progra~1\Java\jdk1.5.0 in your startup.bat file
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MacroLandAuthor Commented:
I have set them all and copied tools.jar from JDK to common\libs


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:434)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:492)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:471)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:459)
      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

Compile failed; see the compiler error output for details.
      org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:938)
      org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:758)
      org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:402)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:492)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:471)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:459)
      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)

the interesting thing is when I start the server with startup.bat and run a JSP file it gives the error  target release 1.3 conflicts with default source release 1.5

does that mean I should install JDK1.3 instead of 1.5
0
kiranhkCommented:
no, i think tomcat 5.xx is requires JDK 1.5
do you have 1.3 also installed, if yes, try uninstalling that and keep only the 1.5
0
MacroLandAuthor Commented:
well I found the problem. The problem arouses with JDK1.5. I have uninstalled it and installed JDK1.3.1 and everything worked out. I dont understand this cause in the manual of Apache, it says server works with any version of J2SE.
0
nitinicsCommented:
I think the path should be pointed upto the bin directory so that it gets the javac compiler.
------------------------------------
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\SI Technologies\ATI Control Panel;C:\Program File\Tools\WinNT;C:\Program Files\Microsoft Visual Sram Files\Microsoft Visual Studio\Common\Tools;C Studio\VC98\bin;C:\Program Files\Java\jdk1.5.0
---------------------------------------
PATH=C:\Program Files\Java\jdk1.5.0\bin

Try this .. it should compile the jsp pages
0
mbenziCommented:
Actuallly I had the same problem.  

I bet you are using Tomcat 5.0.29

This message on the TomcatDev list describes the problem:
http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg64080.html (follow the threads for more details)

A much better solution than using JDK1.3.1 with Tomcat 5.0.29 would be to use JDK 1.5 with Tomcat 5.0.28.  

This is a bug that will be fixed with the next version of  Tomcat,  whereas JDK1.5 is a huge improvement over JDK1.3.1
0
MacroLandAuthor Commented:
You are right. I am using Tomcat 5.0.29
I tried JDK1.5 but it did not work. So I switched to JDK 1.3 and everything was smooth

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.