users@glassfish.java.net

Re: EJB access from remote Stand Alone Client

From: <glassfish_at_javadesktop.org>
Date: Thu, 26 Jun 2008 08:10:45 PDT

You can explicitly set the Global JNDI name of the EnrollSessionBean using an annotation
or sun-ejb-jar.xml. With the annotation it's @Stateless(mappedName="EnrollSessionBean").
If you use sun-ejb-jar.xml, it gets packaged along with ejb-jar.xml in the META-INF directory
of the ejb-jar.

On the client side, make sure you cast the result of the lookup to the Remote Interface type,
not the type of the bean class. Your sample code shows a cast to (EnrollSessionBean).
It should be (EnrollSessionRemote). Of course, that will only matter if the lookup itself
succeeds.
[Message sent by forum member 'ksak' (ksak)]

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