rosshind
asked on
Tomcat - Apache and JSP not finding class files
Hi.
I have a jsp/ java class application on tomcat / Apache. My package is called diablopackage it is located in tomcathome/shared/classes/ diablopack age . I have created a test page to see what the problem might be called indextest.jsp .
I had this working on hte live environment, but I need to create a local copy of the site for testing / redevelopment.
I get errors like this:
An error occurred at line: 18 in the jsp file: /indextest.jsp
Generated servlet error:
/root/jakarta-tomcat-5.0.2 8/work/Cat alina/diab lolocal/_/ org/apache /jsp/index test_jsp.j ava:420: ';' expected
out.print modPresentation.formatMone y(new Double(2.5));
modPresentation is a class in diablopackage which is in my classpath and is imported intothe page using:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page import="java.util.*, java.sql.*, diablopackage.*" %>
at the top. Like I say this was working in hte live environment, but not on my machine. I think it is a configuration issue
I have a jsp/ java class application on tomcat / Apache. My package is called diablopackage it is located in tomcathome/shared/classes/
I had this working on hte live environment, but I need to create a local copy of the site for testing / redevelopment.
I get errors like this:
An error occurred at line: 18 in the jsp file: /indextest.jsp
Generated servlet error:
/root/jakarta-tomcat-5.0.2
out.print modPresentation.formatMone
modPresentation is a class in diablopackage which is in my classpath and is imported intothe page using:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page import="java.util.*, java.sql.*, diablopackage.*" %>
at the top. Like I say this was working in hte live environment, but not on my machine. I think it is a configuration issue
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try deleting the compile jsp after checking it for errors
ASKER
There isnt an error in code. The error message is eroneous. The code has been working fine on the live environment, there is not a prob with missing semi-colons. I get the same or similar errors on every page of the application. The problem is to do with configuration. To eliminate the possibility of syntax errors I have created a test page which is very simple and looks like this:
<code>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page import="java.util.*, java.sql.*, diablopackage.*" %>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
hello
<%
out.print diablopackage.modPresentat ion.format Money(new Double(2.5));
%>
</code>
A point to note, it doesnt matter what I put into the <%@ page import="java.util.*, java.sql.*, diablopackage.*" %> line. I still get the same error on this test page even if i put for example :<%@ page import="javaMadeup.util.*, javaShouldRaiseError.sql.* , diablopackageNotThere.*" %>
I guess nobody has come up with this problem before?
<code>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page import="java.util.*, java.sql.*, diablopackage.*" %>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
hello
<%
out.print diablopackage.modPresentat
%>
</code>
A point to note, it doesnt matter what I put into the <%@ page import="java.util.*, java.sql.*, diablopackage.*" %> line. I still get the same error on this test page even if i put for example :<%@ page import="javaMadeup.util.*,
I guess nobody has come up with this problem before?
ASKER
Forget those <code> and </code> tags, I put that in because I thought experts-exchange would interpret them as HTML, sorry.
ASKER
if I completely delete the page import tag I get the same error. The problem is caused by those imports not working correctly, so the JSP does not have access to anything in diablopackage, or in the other imports...
Any ideas about how I can get the imports working?
Any ideas about how I can get the imports working?
ASKER
Sorry All. I have been following tcompletely the wrong line of enquiry here. You are correct . Sincere apologies.
Great. Glad it was easy to sort out, and thanks for the points and grade :-)
ASKER
2005-05-14 11:22:22 StandardWrapperValve[jsp]:
org.apache.jasper.JasperEx
An error occurred at line: 18 in the jsp file: /indextest.jsp
Generated servlet error:
/root/jakarta-tomcat-5.0.2
out.print diablopackage.modPresentat
^
1 error
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.JspCompi
at org.apache.jasper.servlet.
at org.apache.jasper.servlet.
at org.apache.jasper.servlet.
at javax.servlet.http.HttpSer
at org.apache.catalina.core.A
at org.apache.catalina.core.A
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.valves
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.C
at org.apache.coyote.tomcat5.
at org.apache.jk.server.JkCoy
at org.apache.jk.common.Handl
at org.apache.jk.common.Chann
at org.apache.jk.common.Chann
at org.apache.jk.common.Socke
at org.apache.tomcat.util.thr
at java.lang.Thread.run(Threa