This FAQ is your friend. Search it for the key words and you'll get the examples and explanations.
Basically, you'd use jndi-name via sun-ejb-jar.xml for the remote lookup (you can also use mapped-name in EJB3 version of the ejb-jar.xml for the same purpose). You'd use ejb-link for the local lookup.
Local lookup is not required to be supported via the global JNDI namespace and GlassFish doesn't (this fact is also mentioned in the FAQ).
HTH,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]
http://forums.java.net/jive/thread.jspa?messageID=253501