You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Dignesh <dg...@opentext.com> on 2016/06/13 08:10:54 UTC

JNDI look up fails in user spwaned thread.

Hi,

JNDI look up to EJB's fail if the look up is done from user spawned thread.

I am forking a new thread in my servlet and doing a JNDI look up to EJB, and
it is failing. Is it is a bug or it is expected behaviour.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JNDI-look-up-fails-in-user-spwaned-thread-tp4678861.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Re: JNDI look up fails in user spwaned thread.

Posted by Romain Manni-Bucau <rm...@gmail.com>.
same excepted there the spec forbids explicitly it (tomee tolerates it to
keep common code working but some server just fail when doing that).


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-06-13 14:21 GMT+02:00 Dignesh <dg...@opentext.com>:

> So how about the forking a new thread in message driven bean.I am seeing
> the
> same issue there as well ?
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/JNDI-look-up-fails-in-user-spwaned-thread-tp4678861p4678867.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>

Re: JNDI look up fails in user spwaned thread.

Posted by Dignesh <dg...@opentext.com>.
So how about the forking a new thread in message driven bean.I am seeing the
same issue there as well ?



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JNDI-look-up-fails-in-user-spwaned-thread-tp4678861p4678867.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Re: JNDI look up fails in user spwaned thread.

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

it is expected or more explicitly unspecified. EJB as web env (servlet)
have their own jndi tree (you can configure some parts in ejb-jar.xml or
web.xml) so if you are not in this context then it is up to you to make it
work or not.

Easy workaround is to wrap the lookup in a known context
(ejb.doInContext(() -> return lookup()); for instance)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-06-13 10:10 GMT+02:00 Dignesh <dg...@opentext.com>:

> Hi,
>
> JNDI look up to EJB's fail if the look up is done from user spawned thread.
>
> I am forking a new thread in my servlet and doing a JNDI look up to EJB,
> and
> it is failing. Is it is a bug or it is expected behaviour.
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/JNDI-look-up-fails-in-user-spwaned-thread-tp4678861.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>