Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

Mail Session JNDI Lookup fails on 5.0.25

Matt Raible

2004-05-27


I've been using 4.1.x and 5.0.x for quite some time with the sample
application. This application does a JNDI lookup of a mail session.
This session is configured in my app's context with the following:

  <Resource name="mail/Session" auth="Container"
type="javax.mail.Session"/>
  <ResourceParams name="mail/Session">
     <parameter>
        <name>mail.smtp.host</name>
        <value>localhost</value>
     </parameter>
  </ResourceParams>

My code has worked flawlessly on all Tomcat 4.1.x and Tomcat 5.0.x
releases (even 5.0.24), but it doesn't work on 5.0.25.

Here's my code:

session =
          (Session) new InitialContext().lookup("java:comp/env/" +
                                   
Constants.JNDI_MAIL);

Where Constants.JNDI_MAIL is:

public static final String JNDI_MAIL = "mail/Session";

I noticed that I didn't have a <resource-ref> in my web.xml for this
resource, but adding it didn't fix the problem.

Any idea what changed in 5.0.25?

Thanks,

Matt


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.