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/09/08 13:05:38 UTC

NameNotFoundException during ejb lookups

Hi,

I have 2 beans. A and B. I am binding a object to dignesh namespace in "A".
And I am doing the lookup in another bean B, and it is failing with
namenotfoundexception. Am I doing something wrong here.Can anyone please
help me on this

A.bean: -

Context ctx = new InitialContext();
ctx.rebind("java:global/server/Dignesh", "false");


B.Bean :-

InitialContext initContext = new InitialContext();
initContext.lookup("java:global/server/Dignesh"));


Thank you,






--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/NameNotFoundException-during-ejb-lookups-tp4680063.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Re: NameNotFoundException during ejb lookups

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

each EJB has its own JNDI tree and webapp has one too which can also be
different from beans one (each of them are configurable etc) so that's not
surprising you can't do that (keep in mind you bind a string whatever name
it has and binding in global is not defined, only global EJB names are
defined).


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-09-08 15:05 GMT+02:00 Dignesh <dg...@opentext.com>:

> Hi,
>
> I have 2 beans. A and B. I am binding a object to dignesh namespace in "A".
> And I am doing the lookup in another bean B, and it is failing with
> namenotfoundexception. Am I doing something wrong here.Can anyone please
> help me on this
>
> A.bean: -
>
> Context ctx = new InitialContext();
> ctx.rebind("java:global/server/Dignesh", "false");
>
>
> B.Bean :-
>
> InitialContext initContext = new InitialContext();
> initContext.lookup("java:global/server/Dignesh"));
>
>
> Thank you,
>
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/
> NameNotFoundException-during-ejb-lookups-tp4680063.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>