You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by jlessner <ja...@bertelsmann.de> on 2017/02/08 12:46:44 UTC

JNDI lookup of EJBs from outside the server

Hello everybody
I have troubles performing a JNDI lookup for EJBs from an external client
application. I followed all the explainations I could find from the Tomee
documentation and spend a few hours time now, but I'm still stuck. I'm sure
it is a silly Tomee newbie mistake although I have pretty mich experience
with other application servers.

I'm working with Tomee Plume 7.0.2 which I simply unzipped and started as is
by running startup.bat. I successfully deployed an EJB within a war file and
see the appropriate JNDI binding messages in the application server's
console like that:


The EJB has a remote Interface, so it should be accessible by JNDI lookup.
Then I followed the instructions from  http://tomee.apache.org/clients.html
<http://tomee.apache.org/clients.html>   starting with section "Remote
Client with HTTP (in TomEE)". The lookup failed with a root cause message
like


This message is independent from what I actually provide as the lookup name.
The URL which the application server complains about is the URL which I
configured as the  java.naming.provider.url according to the documentation.

Just to be sure, I also tried to use the OpenEJB provider URLs from the same
documentation page (http://localhost:4204/ejb and ejbd://localhost:4201)
which failed with connection timeout as Tomee obviously does not expect
connections at these ports.

So where is my mistake?




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JNDI-lookup-of-EJBs-from-outside-the-server-tp4681032.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: JNDI lookup of EJBs from outside the server

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Yes, you should have a SecurityException somewhere on the server side


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

2017-02-08 23:12 GMT+01:00 jlessner <ja...@bertelsmann.de>:

> GOT IT!
> It was the default configuration
>
>
>
> I changed that temporarily to allow all classes, setting the whitelist to *
> instead. Now the lookup works well.
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/JNDI-lookup-of-EJBs-from-outside-the-server-
> tp4681032p4681050.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: JNDI lookup of EJBs from outside the server

Posted by jlessner <ja...@bertelsmann.de>.
GOT IT!
It was the default configuration



I changed that temporarily to allow all classes, setting the whitelist to *
instead. Now the lookup works well.




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JNDI-lookup-of-EJBs-from-outside-the-server-tp4681032p4681050.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: JNDI lookup of EJBs from outside the server

Posted by jlessner <ja...@bertelsmann.de>.
Romain,
Thanks for your advice. This brought me one step further. I should have
asked earlier ;-)

However, I'm not yet through. Now I get the following exception from the
lookup call:



Again this happens no matter which lookup name I choose. Hope you have
another idea what the problem may be.

Thanks so far,
Jan




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JNDI-lookup-of-EJBs-from-outside-the-server-tp4681032p4681049.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: JNDI lookup of EJBs from outside the server

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

'new' doc is on http://tomee.apache.org/advanced/client/jndi.html but you
will need to either configure the ejbd servlet or activate default tomee
webapp, see on http://tomee.apache.org/admin/configuration/server.html
tomee.remote.support


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

2017-02-08 13:46 GMT+01:00 jlessner <ja...@bertelsmann.de>:

> Hello everybody
> I have troubles performing a JNDI lookup for EJBs from an external client
> application. I followed all the explainations I could find from the Tomee
> documentation and spend a few hours time now, but I'm still stuck. I'm sure
> it is a silly Tomee newbie mistake although I have pretty mich experience
> with other application servers.
>
> I'm working with Tomee Plume 7.0.2 which I simply unzipped and started as
> is
> by running startup.bat. I successfully deployed an EJB within a war file
> and
> see the appropriate JNDI binding messages in the application server's
> console like that:
>
>
> The EJB has a remote Interface, so it should be accessible by JNDI lookup.
> Then I followed the instructions from  http://tomee.apache.org/
> clients.html
> <http://tomee.apache.org/clients.html>   starting with section "Remote
> Client with HTTP (in TomEE)". The lookup failed with a root cause message
> like
>
>
> This message is independent from what I actually provide as the lookup
> name.
> The URL which the application server complains about is the URL which I
> configured as the  java.naming.provider.url according to the documentation.
>
> Just to be sure, I also tried to use the OpenEJB provider URLs from the
> same
> documentation page (http://localhost:4204/ejb and ejbd://localhost:4201)
> which failed with connection timeout as Tomee obviously does not expect
> connections at these ports.
>
> So where is my mistake?
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/JNDI-lookup-of-EJBs-from-outside-the-server-tp4681032.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>