users@glassfish.java.net

Re: Problem on configuring Java Mail Session

From: <glassfish_at_javadesktop.org>
Date: Sun, 16 Mar 2008 02:08:24 PST

Hi Sahoo,
Below post from 'Frenchdrip' pointed out what my doubt was. Actually I tried followig different ways,
1. directly using resource injection on setter or instance variable
2. inject resource on class level and lookup it from sessionContext
3. inject resource on class level and lookup it from JNDI initial context.

Only 1 gets mailSession object. Both 2 and 3 return mail configuration which requires casting to session. I had never experienced such as well known 'NameNotFoundException' so I don't believe that's a JNDI problem.

Thanks,
Ken
[Message sent by forum member 'dabaner' (dabaner)]

http://forums.java.net/jive/thread.jspa?messageID=264257