users@glassfish.java.net

Re: EJB lookup between different applications on the same server

From: <glassfish_at_javadesktop.org>
Date: Sat, 12 Jul 2008 07:41:53 PDT

Hi

I had many problems with it (still remaining with EJB lookup on another server). The simplest way is to use the mappedName attribute as:

@Stateless(mappedName="myEJB")
class OneClassBean implements OneClassService{
...
}

and in the client:

OneClassService myRemoteObject=(OneClassService )InitialContext.doLookup("myEJB");


In GF Admin console, if you go to Application Server, there is button named JNDI browsing. You can check there the name of the resources deployed on the server. If no mappedName attribute, a strange and complex default name is assigned. In thia way you can control the assigned name, and it works.

Aniceto Perez
[Message sent by forum member 'aperezymadrid' (aperezymadrid)]

http://forums.java.net/jive/thread.jspa?messageID=286155