Hi, i'm trying to get a javax.mail.Session fron JNDI, and getting a 
ClassCastException, even tho if i do System.out.print() of the context lookup, 
i see a javax.mail.Session object instance...

Here is the code:



  | InitialContext ctx = new InitialContext();
  | out.print(ctx.lookup("java:comp/env/mail/DefaultMail"));
  | try{
  |     javax.mail.Session s = 
(javax.mail.Session)ctx.lookup("java:comp/env/mail/DefaultMail");
  | } catch (Exception e) { 
  |     out.println(e); 
  | }
  | 

this is in a jsp, the result on the browser is:

[EMAIL PROTECTED]
java.lang.ClassCastException: javax.mail.Session 

Please advise... Thanks!

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3887396#3887396

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3887396


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to