tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "e-Denton Subscriber" <>
Subject Tomcat 5.0 and JavaMail
Date Wed, 07 Jul 2004 14:49:21 GMT
I had JavaMail working in Tomcat 4, but in Tomcat 5, I am having trouble. I
know it's something simple, perhaps you can see the problem. Mail.jar is in
Tomcat 5.0\common\lib.

I am getting this error:

"javax.naming.NamingException: Cannot create resource instance:"

Using this context in Tomcat 5.0\conf\Catalina\localhost\e_Denton.xml

"<Context displayName="Portal Application"

    <Loader checkInterval="1" />

 <Resource name="mail/Session" auth="Container" type="javax.mail.Session" />
 <ResourceParams name="mail/Session">

And this web.xml:

"<!-- JavaMail Resource -->
  Resource reference to a factory for javax.mail.Session
  preconfigured to connect to the appropriate SMTP server.

Accessed like this:

   Context initContext = new InitialContext();
   Context envContext  = (Context) initContext.lookup("java:comp/env");
   Session session = (Session) envContext.lookup("mail/Session");
  catch (javax.naming.NamingException ne)"

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message