Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent help on struts

Status
Not open for further replies.

yacanna

Programmer
Oct 24, 2003
15
US
Hello,

I have tomcat 5.0 and JDK 1.5 installed. I have deploy a example from book "Struts in Action" (from into tomcat/webapps directory. it is a WAR file. I keep getting the following error. Do you know how to fix it? I appreciate someone can help here.

-----------------------------------------
Exception:
org.apache.jasper.JasperException: Unable to compile class for JSP

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: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(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
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)
 
You have a problem with your classpath. You have to set it properly.

What's your classpath now? Are you using a java IDE or compiling on command line?
 
The java classpath is
C:\program Files\Java\jdk1.5.0_04

Whe I get the WAR example file, it is already compiled. so I didn't compile.

Please let me know of any question. Maybe I can also attach the .WAR file here, someone can put it in your tomcat environment to see if it is working.
 
In struts core file, there are web.xml file; Is this the file I need to modify to set the java classpath?
 
Hi,

Before loding the .WAR just make sure Tomcat is running fine. Run the examples that comes with tomcat. If not make sure the what JDK path does the Tomcat is using.

Try out these first

Venu




 
Where can I find what JDK path does Tomcat is using. Thanks.

If I run the examples that comes with tomcat, get the same error.
 
Hi,

If you are using windows set JAVA_HOME environment variable to the java classpath ex: JAVA_HOME="C:\program Files\Java\jdk1.5.0_04".

For more details you can look at the catalina.bat and setclasspath.bat files under bin dir of TOMCAT_HOME

Hope this will help you, For other details on tomcat you can post the question in tomcat forums
Cheers
Venu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top