Java Mail and JNDI

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Java Mail and JNDI

Vania
Hi,

I need to acquire a java mail session resource and I can not use CDI. How
can I acquire it directly using JNDI lookup? I did try the usual lookup
java:comp/env/mail/ + resource id but it didn't work.

Vania



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Reply | Threaded
Open this post in threaded view
|

Re: Java Mail and JNDI

Romain Manni-Bucau
Hi Vania,

use openejb:Resource/<resource id> or java:openejb/Resource/<resource id>


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>

2018-04-18 11:31 GMT+02:00 Vania <[hidden email]>:

> Hi,
>
> I need to acquire a java mail session resource and I can not use CDI. How
> can I acquire it directly using JNDI lookup? I did try the usual lookup
> java:comp/env/mail/ + resource id but it didn't work.
>
> Vania
>
>
>
> --
> Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-
> f979441.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Java Mail and JNDI

Vania
It worked.

Thank you very much.



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html