Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Tomcat Problem

Posted on 2004-10-21
10
Medium Priority
?
3,459 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:MacroLand
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 8

Expert Comment

by:kiranhk
ID: 12371672
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
 
LVL 4

Author Comment

by:MacroLand
ID: 12371827
u mean the path in enviromental variables ?
0
 
LVL 4

Author Comment

by:MacroLand
ID: 12373368
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Accepted Solution

by:
kiranhk earned 150 total points
ID: 12373648
try putting
JAVA_HOME=C:\Progra~1\Java\jdk1.5.0 in your startup.bat file
0
 
LVL 4

Author Comment

by:MacroLand
ID: 12373970
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
 
LVL 8

Expert Comment

by:kiranhk
ID: 12374258
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
 
LVL 4

Author Comment

by:MacroLand
ID: 12374549
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
 

Expert Comment

by:nitinics
ID: 12600620
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
 

Expert Comment

by:mbenzi
ID: 12629438
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
 
LVL 4

Author Comment

by:MacroLand
ID: 12629511
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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

610 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