  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | | | org.apache.jasper.JasperException: Unable to compile class for JSP | org.apache.jasper.JasperException: Unable to compile class for JSP 2004-05-21 - By aiye4686@(protected)
Back
Hi, and thanks for reading this query - it isn't (at least to me) anything to do with putting tools.jar into web-inf/lib, or anywhere else, for that matter.
Here is the problem:
2004-05-22 02:25:00 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException : Unable to compile class for JSP
No Java compiler was found to compile the generated source for the JSP. This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK to the common/lib directory of the Tomcat server, followed by a Tomcat restart. If using an alternate Java compiler, please check its installation and access path.
at org.apache.jasper.compiler.DefaultErrorHandler (DefaultErrorHandler .java:127) at org.apache.jasper.compiler.ErrorDispatcher (ErrorDispatcher.java:351) at org.apache.jasper.compiler.Compiler (Compiler.java:415) at org.apache.jasper.compiler.Compiler (Compiler.java:458) at org.apache.jasper.compiler.Compiler (Compiler.java:439) at org.apache.jasper.JspCompilationContext (JspCompilationContext.java:552) at org.apache.jasper.servlet.JspServletWrapper (JspServletWrapper.java:291) at org.apache.jasper.servlet.JspServlet (JspServlet.java:301) at org.apache.jasper.servlet.JspServlet (JspServlet.java:248) at javax.servlet.http.HttpServlet (HttpServlet.java:856) at org.apache.catalina.core.ApplicationFilterChain  (ApplicationFilterChain.java:284) at org.apache.catalina.core.ApplicationFilterChain (ApplicationFilterChain .java:204) at org.apache.catalina.core.StandardWrapperValve (StandardWrapperValve.java :256) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext .java:151) at org.apache.catalina.core.StandardPipeline (StandardPipeline.java:564) at org.apache.catalina.core.StandardContextValve  (StandardContextValve.java:245) at org.apache.catalina.core.StandardContextValve (StandardContextValve.java :199) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext .java:151) at org.apache.catalina.core.StandardPipeline (StandardPipeline.java:564) at org.apache.catalina.core.StandardHostValve (StandardHostValve.java:195) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext .java:151) at org.apache.catalina.valves.ErrorReportValve (ErrorReportValve.java:164) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext .java:149) at org.apache.catalina.valves.AccessLogValve (AccessLogValve.java:578) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext .java:149) at org.apache.catalina.core.StandardPipeline (StandardPipeline.java:564) at org.apache.catalina.core.StandardEngineValve (StandardEngineValve.java :156) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext .java:151) at org.apache.catalina.core.StandardPipeline (StandardPipeline.java:564) at org.apache.catalina.core.ContainerBase (ContainerBase.java:972) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211) at org.apache.coyote.http11.Http11Processor (Http11Processor.java:805) at org.apache.coyote.http11.Http11Protocol $Http11ConnectionHandler .processConnection(Http11Protocol.java:696) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605) at org.apache.tomcat.util.threads.ThreadPool $ControlRunnable.run(ThreadPool.java :677) at java.lang.Thread (Thread.java:536)
Here is what has been happening:
I am doing a thesis involving using tomcat+hibernate+mysql to create a web-site that auto-marks web applications.
Using Tomcat ver. 5.
Until yesterday I could fire up tomcat, run my code, make changes to .jsp and .java files and, without restarting tomcat, see the changes. Yes, tools.jar, and in fact ALL the necessary jar files for rinning my app are in the right place. The application has been running smoothly for about 2 months now.
Today I began to use ant (in a java file - by importing org.apache.tools.ant.*) to deploy .war files in a particular directory when I wanted to. To do so appeared to require the use of a manager setting, so I made on up, and added it to TOMCAT_HOME\conf\tomcat-users.xml. Here is the entry:
<user username="andrew" password="iyer" roles="manager"/>
Which was put with the other entries.
NOW when I went to the website 1.jsp in TOMCAT_HOME\webapps\thesis (contents as follows) I got the above "org.apache.jasper.JasperException : Unable to compile class for JSP" error.
1.jsp: <%@ page language="java" contentType = "text/html"%> <%@ page import="org.apache.tools.ant.*" %> <%@ page import="org.apache.catalina.ant.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<% DeployTask deployer = new DeployTask(); deployer.setUsername("andrew"); deployer.setPassword("iyer"); deployer.setUrl("http://localhost:8080/manager") deployer.setPath("/demo"); deployer.setLocalWar("C:/struts-blank.war"); deployer.execute(); %>
Not being sure what the problem is, I made 2.jsp, to see if everything was going ok, put it in the same dir as 1.jsp, and visited it. Same error as above, and here are the contents for 2.jsp:
<html> <body> moomoo! </body> </html>
Which is odd, because if I call the file 2.html and no error appears.
Finally, I started loading my application files to see if anything else had gone wrong - my application worked fine. To do so, I go to index.jsp to log in, log in, play around and exit. No dramas.
I then edited index.jsp (this file worked fine 2 min ago) by hitting enter once at the top of the page, and then saving the file. Go to index.jsp and I get the above error.
It appears to me that this is something to do with a tomcat config problem - it might be having trouble recognising .jar files, but I've checked and all my jar files are where they should be! I suspect it might have something to do with me adding the manager into tomcat-users, but that seems pretty tenuous, as this hasn't been noted anywhere else on the web. I can't see any other possibiliby except maybe timestamp issues?
Before any .jar questions are asked, here is my .jar file list:
.JAR Files in TOMCAT_HOME\common\lib: ant.jar; catalina-ant.jar commons-collections.jar; commons-el.jar; commons-pool-1 (See http://ool-1.ora-code.com).1.jar; jasper-compiler.jar; jasper-runtime.jar; jmx.jar; jmx-remote.jar; jmx-remote-tools.jar; jsp-api.jar; mysql-connector-jave-3 (See http://ave-3.ora-code.com).1.1-alpha-bin.jar; mysql-resourcefactory.jar; naming-common.jar; naming-factory.jar; naming-java.jar; naming-resources.jar; serlvet.jar; tools.jar;
.JAR files in TOMCAT_HOME\webapps\thesis\WEB-INF\lib: cglib-full-2 (See http://ull-2.ora-code.com).0.1.jar; commons-collections-2 (See http://ons-2.ora-code.com).1.jar; commons0logging-1 (See http://ing-1.ora-code.com).0.3.jar; dom.jar; dom4j-1.4.jar; ehcache-0 (See http://che-0.ora-code.com).7.jar; hibernate2.jarl jaxen-full.jar; jstl.jar; jta.jar; jaxp-api.jar; jdbc-2 (See http://dbc-2.ora-code.com)_0-stdext.jar; log4j-1.2.8.jar; odmg-3 (See http://dmg-3.ora-code.com).0.jar; sax.jar; saxpath.jar; standard.jar; xalan-2 (See http://lan-2.ora-code.com).4.0.jar; xerces-2 (See http://ces-2.ora-code.com).4.0.jar;
Any help would be greatly appreciated, I really have no idea why my application is no longer running.
Cheers Andrew
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ This message was sent using IMP, the Internet Messaging Program.
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected) For additional commands, e-mail: tomcat-user-help@(protected)
|
|
 |