Forums Register Login

javaMail error

+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
Hi,

Thanks for the response. I am using javax.mail.Session
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1534 times.
Similar Threads
Getting "Lookup Error Name comp/env/mail not found in context "java:"." error
Why jsp can't send javamail?
not getting session
MDB @PostConstruct error
Tomcat/Javamail Question
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 04:28:17.