The Java Mail session created on Glassfish works well if it is injected as @Resource (name="mail/myMail"), but it fails on direct using JNDI as following,
...
InitialContext ctx = new InitialContext();
Session session = (Session)ctx.lookup("mail/myMail");
...
the exceptioin is exactly the same as the spring case. MailConfiguration can not be cast to MailSession etc. Can someone give some lights on this?
[Message sent by forum member 'dabaner' (dabaner)]
http://forums.java.net/jive/thread.jspa?messageID=263316