I finally figured it out.
The javamail taglib classes have to be in a package inside the JAR. I
don't think the specifications say this so it might be a problem with
tomcat 4.0.3!?!?
So, I put them all in package "bigcahoona" and it works except for one
thing.
If I don't have the following in the messageheaders.jsp file I get an
error...
<%@ page import="bigcahoona.MessageInfo" %>
Generated servlet error:
C:\jakarta-tomcat-4.0.3\work\localhost\javamail\messageheaders$jsp.java:
87: Class org.apache.jsp.MessageInfo not found.
MessageInfo msginfo = null;
^
>From what I can see, this is what's happening here.
This code...
<javamail:listmessages
id="msginfo"
folder="folder">
in the messageheaders.jsp causes access to the MessageInfo class inside
the bigcahoona.ListMessagesTag class. Now, correct me if I'm wrong, but
if they are in the same package, shouldn't tomcat automatically get
MessageInfo out of the JAR file and use it? In other words, I shouldn't
have to explicitly load it with the import or with a <tag> inside the
TLD file. Right? After all, MessageInfo is not a tag class, it's only
derived from Object.
So, bug in Tomcat? Anyone that's a hardcore developer on tomcat
listening? I could send you the packaged up WAR to take a look if you
want.
Oh, and another thing. From what I can see, tomcat isn't following the
specs in another area. I need to have a taglib.tld outside of the tag
library JAR in order to get it to work. According to the JSP 1.2 specs
(JSP sections 7.2.1 AND 7.3.1), a TLD file in the META-INF directory
should suffice? So, shouldn't the standalone JAR file be enough to
access the tags without having an external TLD file?
-----Original Message-----
From: Phillip Morelock [mailto:[EMAIL PROTECTED]]
Sent: May 29, 2002 11:24 PM
To: Tomcat Users List
Subject: Re: STATUS 500 - Unable to compile class for JSPNote
import the class by making this the top line in your jsp:
<%@ page language="java" contentType="text/html"
import="ListMessagesTag" %>
The real answer is that you should take some time to learn about
packages and jars, but for just getting started, etc., the above
*should* fix your current problem. Tomcat is looking for your class in
its default JSP package scope, org.apache.jsp.* . Explicitly importing
the class gets around this.
To learn about packages:
http://java.sun.com/docs/books/tutorial/java/interpack/packages.html
To learn about jars: http://java.sun.com/docs/books/tutorial/jar/
cheers and have fun,
fillup
On 5/29/02 10:04 PM, "Trenton D. Adams" <[EMAIL PROTECTED]>
wrote:
> I get the following error and I have no idea how to fix it. I'm
> attempting to get the javamail IMAP example going, but it doesn't want
> to work. I've had to modify several files and it still won't work.
>
> I understand that this has to do with a program that has nothing to do
> with tomcat, but I don't understand the errors below. So, I was
> hoping the TomCat Developers could help! :)
>
> Now the funny thing is that I don't have a class that correspond to
> org.apache.jsp.ListMessagesTag. I do have a ListMessagesTag class,
> but not org.apache.jsp.ListMessagesTag.
>
> After the error is messageheaders.jsp from line 65 to 98.
>
>
> Misc Details
> JDK1.4.0 final
> Tomcat 4.0.3
>
>
>
> Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error
> ----------------------------------------------------------------------
> --
> --------
> type Exception report
> message Internal Server Error
> description The server encountered an internal error (Internal Server
> Error) that prevented it from fulfilling this request.
> exception
> org.apache.jasper.JasperException: Unable to compile class for
JSPNote:
> sun.tools.javac.Main has been deprecated.
>
> An error occurred between lines: 65 and 67 in the jsp file:
> /messageheaders.jsp Generated servlet error:
>
C:\jakarta-tomcat-4.0.3\work\localhost\javamail\messageheaders$jsp.java:
> 72: Class org.apache.jsp.ListMessagesTag not found.
> ListMessagesTag _jspx_th_javamail_listmessages_0 = new
> ListMessagesTag();
> ^
>
> An error occurred between lines: 65 and 67 in the jsp file:
> /messageheaders.jsp Generated servlet error:
>
C:\jakarta-tomcat-4.0.3\work\localhost\javamail\messageheaders$jsp.java:
> 72: Class org.apache.jsp.ListMessagesTag not found.
> ListMessagesTag _jspx_th_javamail_listmessages_0 = new
> ListMessagesTag();
> ^
>
> An error occurred between lines: 65 and 67 in the jsp file:
> /messageheaders.jsp Generated servlet error:
>
C:\jakarta-tomcat-4.0.3\work\localhost\javamail\messageheaders$jsp.java:
> 87: Class org.apache.jsp.MessageInfo not found.
> MessageInfo msginfo = null;
> ^
>
> An error occurred between lines: 65 and 67 in the jsp file:
> /messageheaders.jsp Generated servlet error:
>
C:\jakarta-tomcat-4.0.3\work\localhost\javamail\messageheaders$jsp.java:
> 88: Class org.apache.jsp.MessageInfo not found.
> msginfo = (MessageInfo)
> pageContext.findAttribute("msginfo");
> ^
>
> An error occurred at line: 83 in the jsp file: /messageheaders.jsp
> Generated servlet error:
> C:\jakarta-tomcat-4.0.3\work\localhost\javamail\messageheaders$jsp.jav
> a:
> 131: Variable msginfo may not have been initialized.
> out.print( msginfo.getDate() );
> ^
> 5 errors, 1 warning
>
> at
> org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
> at
> org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
> at
> org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary
> (J
> spServlet.java:177)
> at
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle
> t.java:189)
> at
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
> at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc
> her.java:683)
> at
>
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp
> atcher.java:431)
> at
>
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat
> cher.java:355)
> at FilterServlet.doGet(FilterServlet.java:85)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
> tionFilterChain.java:247)
> at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
> erChain.java:193)
> at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
> e.java:243)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:566)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
> 72)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
> e.java:190)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:566)
> at
>
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja
> va:246)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:564)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
> 72)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234
> 3)
> at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
> :180)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:566)
> at
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
> lve.java:170)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:564)
> at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
> :170)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:564)
> at
>
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468
> )
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:564)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
> 72)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
> java:174)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:566)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
> 72)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j
> ava:1012)
> at
>
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:
> 1107)
> at java.lang.Thread.run(Thread.java:536)
>
> ----------------------------------------------------------------------
> --
> --------
>
>
>
> messageheaders.jsp lines 65-98
>
> <javamail:listmessages
> id="msginfo"
> folder="folder">
> <%-- from --%>
> <tr valign=middle>
> <td width="25%" bgcolor="ffffff">
> <font face="Arial,Helvetica">
> <% if (msginfo.hasFrom()) { %>
> <%= msginfo.getFrom() %>
> </font>
> <% } else { %>
> <font face="Arial,Helvetica,sans-serif">
> Unknown
> <% } %>
> </font></td>
> <%-- date --%>
> <td nowrap width="15%" bgcolor="ffffff">
> <font face="Arial,Helvetica">
> <%= msginfo.getDate() %>
> </font></td>
> <%-- subject & link --%>
> <td bgcolor="ffffff">
> <font face="Arial,Helvetica">
> <a href="messagecontent?message=<%= msginfo.getNum() %>">
> <% if (msginfo.hasSubject()) { %>
> <%= msginfo.getSubject() %>
> <% } else { %>
> <i>No Subject</i>
> <% } %>
> </a>
> </font></td>
> </tr>
> </javamail:listmessages>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>