Hi,
I have a struts-based application running within embedded Tomcat - it works fine on my machine. However, when I move it to another machine and try to run it I get an error from ONE of the jsps - others run fine. The error I get is:
-----
org.apache.jasper.JasperEx
ception: 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.
org.apache.jasper.compiler
.DefaultEr
rorHandler
.javacErro
r(DefaultE
rrorHandle
r.java:83)
org.apache.jasper.compiler
.ErrorDisp
atcher.jav
acError(Er
rorDispatc
her.java:3
15)
org.apache.jasper.compiler
.Compiler.
generateCl
ass(Compil
er.java:40
6)
org.apache.jasper.compiler
.Compiler.
compile(Co
mpiler.jav
a:463)
org.apache.jasper.compiler
.Compiler.
compile(Co
mpiler.jav
a:442)
org.apache.jasper.compiler
.Compiler.
compile(Co
mpiler.jav
a:430)
org.apache.jasper.JspCompi
lationCont
ext.compil
e(JspCompi
lationCont
ext.java:5
11)
org.apache.jasper.servlet.
JspServlet
Wrapper.se
rvice(JspS
ervletWrap
per.java:2
74)
org.apache.jasper.servlet.
JspServlet
.serviceJs
pFile(JspS
ervlet.jav
a:292)
org.apache.jasper.servlet.
JspServlet
.service(J
spServlet.
java:236)
javax.servlet.http.HttpSer
vlet.servi
ce(HttpSer
vlet.java:
810)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.25 logs.
---------
My JSP file is:
---------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib uri="/WEB-INF/struts-html.
tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.
tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic
.tld" prefix="logic" %>
<html:html locale="true">
<logic:notPresent name="vstaff" scope="application">
<logic:redirect href="initialise.do"/>
</logic:notPresent>
<HEAD>
<%@ page
language="java"
import = "uk.co.xks.vtrack.forms.Si
gninForm, uk.co.xks.vtrack.forms.Sta
ffForm, java.util.Enumeration, java.util.Vector"
contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"
%>
<% Vector vstaff = (Vector) getServletContext().getAtt
ribute("vs
taff"); %>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM WebSphere Studio">
<META http-equiv="Content-Style-
Type" content="text/css">
<LINK href="theme/vtrack.css" rel="stylesheet" type="text/css">
<TITLE><bean:message key="index.title"/></TITLE
>
</HEAD>
<BODY>
<center>
<h4><bean:message key="index.welcome"/></h4>
<table width="100%" cellpadding="8" border="0" rules="rows" align="center">
<tr height="20"><td colspan="3"></td></tr>
<tr><td width="20%" valign="top"><html:img srcKey="image.company_logo
" altKey="image.company_logo
.alt"/></t
d>
<td align="center"><h1><bean:m
essage key="index.signin"/></h1><
h5><bean:m
essage key="index.info"/></h5>
<html:errors/>
<html:form action="signin.do" focus="visitorName">
<table>
<tr valign="top"><td width="50%" align="right"><h3><bean:me
ssage key="index.name"/></h3></t
d>
<td width="50%" align="left"><input type="text" name="visitorName" size="30" tabindex="1"></td></tr>
<tr valign="top"><td width="50%" align="right"><h3><bean:me
ssage key="index.company"/></h3>
</td>
<td width="50%" align="left"><input type="text" name="companyName" size="30" tabindex="2"></td></tr>
<tr valign="top"><td width="50%" align="right"><h3><bean:me
ssage key="index.car_reg"/></h3>
</td>
<td width="50%" align="left"><input type="text" name="carRegistration" size="30" tabindex="3"></td></tr>
<tr valign="top"><td width="50%" align="right"><h3><bean:me
ssage key="index.visiting"/></h3
></td>
<td width="50%" align="left">
<html:select property="visitingName">
<html:options collection="vstaff" labelProperty="staffName" property="staffId"/></html
:select></
td></tr>
<tr align="center">
<td align="right"><html:submit
><bean:mes
sage key="button.signin" /></html:submit></td>
<td align="center"><html:reset
><bean:mes
sage key="button.reset" /></html:reset></td>
</tr>
</table>
</html:form>
</td><td></td></tr></table
>
<table><tr height="70"><td></td></tr>
</table>
<table width="100%" cellpadding="8" border="0" rules="rows" align="center">
<tr align="center">
<td><h1><bean:message key="index.logout1"/> <a href="listvisitors.do"><be
an:message
key="index.logout2"/></a><
/h1></td>
</tr>
</table>
<table width="100%" border="0" rules="rows" align="center">
<tr valign="bottom">
<td align="center"><html:img srcKey="image.spare_logo1"
altKey="image.spare_logo1.
alt"/></td
>
<td align="center"><html:img srcKey="image.spare_logo2"
altKey="image.spare_logo2.
alt"/></td
>
<td align="center"><html:img srcKey="image.spare_logo3"
altKey="image.spare_logo3.
alt"/></td
>
<td align="center"><html:img srcKey="image.spare_logo4"
altKey="image.spare_logo4.
alt"/></td
>
</tr>
</table>
</BODY>
</html:html>
--------
As I said, other JSPs in the application work fine, so I ssumed it might be a typo but I've checked and checked and cannot find one (all "" ; etc are okay as far as I can tell). I've included the tools.jar in my classpath (set in a bat file when the app runs).
Does anyone have any ideas?