users@glassfish.java.net

Re: Lookup JavaMail session

From: <forums_at_java.net>
Date: Wed, 4 Sep 2013 21:21:23 -0500 (CDT)

yes, I tried the jndi name "mail/loggingMailSesson" and it can work well.
your mentioned jndi name starting with "java:[global, app, comp ... ] is the
portable jndi name. That could work with java:comp/env/mail/loggingMailSesson
according to the glassfish doc here :
http://docs.oracle.com/cd/E26576_01/doc.312/e24930/javamail.htm#beapa however
I didn't try it. but "mail/loggingMailSesson" just work using
Context.lookup("...") , I created one web application and I can lookup it
with the name. and you are right for the injection, if the log handler is not
a managed component ,the injection can't work.

--
[Message sent by forum member 'lemon_zhang']
View Post: http://forums.java.net/node/898585