|
I've seen this problem posted before, but I
couldn't find a solution. Any ideas would be greatly appreciated!
I'm attempting to use JavaMail from a JSP, but the
page will not compile. I recieve the following
two errors:
org.apache.jasper.JasperException: Unable to
compile class for
JSP/opt/software/jakarta-tomcat/work/.../_0002fMailTest_0002ejspMailTest_jsp_0.java:15:
Package javax.mail not found in import.
import javax.mail.*; ^ /opt/software/jakarta-tomcat/work/.../_0002fMailTest_0002ejspMailTest_jsp_0.java:16: Package javax.mail.internet not found in import. import javax.mail.internet.*; ^ 2 errors Here are the first few lines of the
JSP:
<%@page import="java.io.*"%>
<%@page import="java.util.*"%> <%@page import="javax.mail.*"%> <%@page import="javax.mail.internet.*"%> mail.jar and activation.jar are in the WEB-INF/lib
directory and are included in the resulting classpath as reflected
in jasper.log:
Classpath according to the Servlet Engine is: ...
:<docBase>/WEB-INF/lib/activation.jar:<docBase>/WEB-INF/lib/mail.jar
<docBase> is the full path
to the base directory for the given servlet context.
I have a couple of dozen JSP's that use other
dependent classes. In every case, the packages are imported just like MailTest,
and the corresponding jar files are in the WEB-INF/lib directory. The situation
seems to be identical, but the page that attempts to import the JavaMail
packages will not compile.
By the way, there are 17 jar files in my
WEB-INF/lib directory, all of which are added properly to the classpath produced
by Tomcat (as seen in Jasper.log). Seemingly by coincidence, mail.jar and
activation.jar are the last two files specified in the classpath. Could that
have anything to do with it?
This is Tomcat 3.1 on Solaris using
Apache.
Thanks for any
suggestions!
|
