Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

javaMail error  RSS feed

 
Patrick Mugabe
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I am getting the following error message.

javax.naming.NameNotFoundException: No object bound to name java:comp/env/mail/Notification

I set up a java mail Session resouce with a JNDI name mail/Notification.

In my code I am getting the Session using:

Context ic = new InitialContext();
mailSession = (Session)ic.lookup("java:comp/env/mail/Notification");

I have also tried to just use mail/Notification but then it gives the error com.sun.enterprise.deployment.MailConfiguration cannot be cast to Session.

Can anyone assist. I can't see where I am going wrong.
[ May 08, 2007: Message edited by: Patrick Wegono ]
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the package to which your Session belongs.As there are many Session classes available , but under different packages.I am suspecting you are using a different one.
I guess its because of the IDE's helping prompt.
 
Patrick Mugabe
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the response. I am using javax.mail.Session
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!