You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Chris Owens <ct...@chris-owens.com> on 2016/04/09 22:42:30 UTC

Portable JNDI names

I am using 7.0.0-M3, which I believe implements EJB3.1, which I believe
includes portable JNDI syntax.

All JNDI naming uses the default template. 

When I create a stateless bean, I'm seeing a JNDI name being bound in
*global*, but not in *module *or *app*.  Do I need to do something to cause
TomEE to bind the portable JNDI names in the module and app namespaces?

MyBean.java:


Log output:




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Portable-JNDI-names-tp4678113.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Portable JNDI names

Posted by Romain Manni-Bucau <rm...@gmail.com>.
not sure what you did but looks like internal names. If you can debug
in tomee code you will find them here
https://github.com/apache/tomee/blob/master/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java#L693

Romain Manni-Bucau
@rmannibucau |  Blog | Github | LinkedIn | Tomitriber


2016-04-13 7:34 GMT+02:00 Chris Owens <ct...@chris-owens.com>:
> OK, so I started looking around the JNDI namespace, and I found these names
> for my bean whose @Local interface is MyBean and whose @Stateless
> implementation class is  MyBeanImplBut nothing in app or module.Does this
> suggest what I have missed in the configuration?
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/Portable-JNDI-names-tp4678113p4678125.html
> Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Portable JNDI names

Posted by Chris Owens <ct...@chris-owens.com>.
OK, so I started looking around the JNDI namespace, and I found these names
for my bean whose @Local interface is MyBean and whose @Stateless
implementation class is  MyBeanImplBut nothing in app or module.Does this
suggest what I have missed in the configuration?



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Portable-JNDI-names-tp4678113p4678125.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Portable JNDI names

Posted by Romain Manni-Bucau <rm...@gmail.com>.
2016-04-12 18:12 GMT+02:00 Chris Owens <ct...@chris-owens.com>:
> Romain Manni-Bucau wrote
>> We respect https://docs.oracle.com/cd/E19798-01/821-1841/girgn/index.html
>> so module lookup will work if your are in the same module and app lookup
>> will work for the whole application.
>
> Specifically in this case, does being "in the same module" mean executing
> code that was packaged in the same jar as the code that defined the EJB?
>
> What if we have this:
>
>
> If MyClass defines an EJB, can code in OtherClass fetch it from JNDI with
> java:module/MyClass?
>
> Conversely, if OtherClass defines and EJB, can code in MyClass fetch it with
> java:module/OtherClass?
>

Normally no

> I just can't find a good description of this. is there some reference
> material that I'm just missing here?
>

JavaEE specification defines what is a module but each server
"workaround" or adapt it depending their phylosophy AFAIK so I can
understand it is not obvious.

> Thanks again for your patience.  I will (per my note in the website thread
> in the dev list) try to write up what I find.
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/Portable-JNDI-names-tp4678113p4678123.html
> Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Portable JNDI names

Posted by Chris Owens <ct...@chris-owens.com>.
Romain Manni-Bucau wrote
> We respect https://docs.oracle.com/cd/E19798-01/821-1841/girgn/index.html
> so module lookup will work if your are in the same module and app lookup
> will work for the whole application.

Specifically in this case, does being "in the same module" mean executing
code that was packaged in the same jar as the code that defined the EJB?  

What if we have this:


If MyClass defines an EJB, can code in OtherClass fetch it from JNDI with
java:module/MyClass?

Conversely, if OtherClass defines and EJB, can code in MyClass fetch it with
java:module/OtherClass?

I just can't find a good description of this. is there some reference
material that I'm just missing here?

Thanks again for your patience.  I will (per my note in the website thread
in the dev list) try to write up what I find.





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Portable-JNDI-names-tp4678113p4678123.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Portable JNDI names

Posted by Romain Manni-Bucau <rm...@gmail.com>.
We respect https://docs.oracle.com/cd/E19798-01/821-1841/girgn/index.html
so module lookup will work if your are in the same module and app lookup
will work for the whole application.
Le 12 avr. 2016 02:33, "Chris Owens" <ct...@chris-owens.com> a
écrit :

> Romain Manni-Bucau wrote
> > it is but not logged cause usable depending "where" you are so we only
> > log global names.
>
> I don't understand what you mean by "cause usable depending 'where' you
> are."
>
> What is the correct portable JNDI name I should use to refer to this bean?
>
>
>
> Thanks again,
>
> /c
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Portable-JNDI-names-tp4678113p4678115.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: Portable JNDI names

Posted by Chris Owens <ct...@chris-owens.com>.
Romain Manni-Bucau wrote
> it is but not logged cause usable depending "where" you are so we only
> log global names.

I don't understand what you mean by "cause usable depending 'where' you
are." 

What is the correct portable JNDI name I should use to refer to this bean?



Thanks again,

/c




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Portable-JNDI-names-tp4678113p4678115.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Portable JNDI names

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

it is but not logged cause usable depending "where" you are so we only
log global names.

Romain Manni-Bucau
@rmannibucau |  Blog | Github | LinkedIn | Tomitriber


2016-04-09 22:42 GMT+02:00 Chris Owens <ct...@chris-owens.com>:
> I am using 7.0.0-M3, which I believe implements EJB3.1, which I believe
> includes portable JNDI syntax.
>
> All JNDI naming uses the default template.
>
> When I create a stateless bean, I'm seeing a JNDI name being bound in
> *global*, but not in *module *or *app*.  Do I need to do something to cause
> TomEE to bind the portable JNDI names in the module and app namespaces?
>
> MyBean.java:
>
>
> Log output:
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/Portable-JNDI-names-tp4678113.html
> Sent from the TomEE Users mailing list archive at Nabble.com.