tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: urgent : using Mail Resource in web.xml
Date Sun, 02 Sep 2001 05:44:15 GMT
Can you try putting "mail.jar" into "common/lib"?  That way, it is
available to both the Catalina internal classes (including the resource
factory) and your web app?

Craig McClanahan


On Thu, 30 Aug 2001, Christoph Rooms wrote:

> Date: Thu, 30 Aug 2001 20:00:53 +0200
> From: Christoph Rooms <christoph.rooms@pandora.be>
> Reply-To: tomcat-user@jakarta.apache.org
> To: tomcat-user@jakarta.apache.org
> Subject: urgent : using Mail Resource in web.xml
>
> hi,
>
> I'm trying to get a mail session I define in the web.xml
> ------------------------------------
> <resource-ref>
>   <description>Default Mail</description>
>   <res-ref-name>TheMailSession</res-ref-name>
>   <res-type>javax.mail.Session</res-type>
>   <res-auth>Container</res-auth>
>  </resource-ref>
> ------------------------------------
>
>
> And I call it in my java code like :
> ------------------------------------
>     Context initial = new InitialContext();
>     Session session = (Session)
> initial.lookup("java:comp/env/TheMailSession");
> ------------------------------------
>
> This is the exception I get :
> ------------------------------------
> A Servlet Exception Has Occurred
> Exception Report:
> javax.servlet.ServletException: Servlet execution threw an exception
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:269)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:193)
> 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:243)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:219)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> 	at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
> .java:472)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 64)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2251)
> 	at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> )
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> 	at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 64)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :163)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
> org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
> 984)
> 	at
> org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1074
> )
> 	at java.lang.Thread.run(Thread.java:484)
>
> Root Cause:
> java.lang.NoClassDefFoundError: javax/mail/Session
> 	at
> org.apache.naming.factory.MailSessionFactory$1.run(MailSessionFactory.java:1
> 63)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at
> org.apache.naming.factory.MailSessionFactory.getObjectInstance(MailSessionFa
> ctory.java:147)
> 	at
> org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.
> java:165)
> 	at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:307)
> 	at org.apache.naming.NamingContext.lookup(NamingContext.java:835)
> 	at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
> 	at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
> 	at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
> 	at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
> 	at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
> 	at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:350)
> 	at rnb.SendMail.doGet(SendMail.java:21)
> 	at rnb.SendMail.doPost(SendMail.java:78)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:247)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:193)
> 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:243)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:219)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> 	at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
> .java:472)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 64)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2251)
> 	at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> )
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> 	at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 64)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :163)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
> org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
> 984)
> 	at
> org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1074
> )
> 	at java.lang.Thread.run(Thread.java:484)
>
> ------------------------------------
>
> You see, a no class found error ... but even if I put mail.jar in the lib
> directory of the server ... no change ...
>
> Thanks !
> Christoph
>
> ----- Original Message -----
> From: "Ruben Domene" <rdomene@svalero.es>
> To: "tomcat" <tomcat-user@jakarta.apache.org>
> Sent: Thursday, August 30, 2001 1:34 AM
> Subject: How a html file pass arguments to a servlet??
>
>
> > Hi.
> > I need know how from a html file i can send arguments to servlet.
> > Thank you for your helps.
> >
>
>


Mime
View raw message