users@glassfish.java.net

Re: EJB access from remote Stand Alone Client

From: rdblaha1 <rd_blaha_at_hotmail.com>
Date: Thu, 26 Jun 2008 06:45:52 -0700 (PDT)

Thank you ksak. I was encouraged that I must be close. I have tried various
combinations with my somewhat limited understanding. If I could have a
little more instruction on a few points I again would greatly appreciate it.



glassfish wrote:
>
> The client-side JNDI code looks fine, except for the argument to the
> lookup method. You have to
> make sure that the string you're passing in matches the global JNDI name
> of the target Remote
> EJB. By default (in Glassfish), the Remote EJB is assigned a global JNDI
> name equal to its
> fully-qualified Remote interface name.
>

For my jndiCtx.lookup( <name>) I have used what I had in my original post -
EnrollSessionBean which obviously did not work (hence the point of my
original post). I tried what I understood from your statement
(fully-qualified Remote interface name) - EnrollSessionRemote (same
results). My code snippet from my EJB is:

@Stateless
public class EnrollSessionBean implements EnrollSessionRemote {

Again, this is in the EJBTest project jar.

Note that using the Glassfish admin console on the host I looked at the
deployed EJB Module - EJBTest under Applications >> EJB Modules. You said
by default the JNDI name for the deployed Remote EJB Module would be the
fully-qualified Remote interface name. Unfortunately neither the EJB Module
listing for EJBTest nor in the JNDI listings did I find this shown. The
JNDI name default apparently is behind the scenes if I understand correctly.



> That default can be overridden by setting the
> @Stateless/_at_Stateful mappedName() attribute or by setting the jndi-name
> attribute in the
> corresponding sun-ejb-jar.xml.
>

In my original post I quoted from the EJB 3.0 Stateless Session Bean example
stating I wouldn't need to define certain xml files including the
sun-ejb-jar.xml. Do I understand correctly that the sun-ejb-jar.xml should
only be used in this case if I wish to change the Glassfish default
jndi-name attribute? Which directory does this file get placed in? The
same as the jndi.properties (src - conf - META-INF) or just the src - conf?

I know this should be simple and hopefully your answer will get me headed in
the right direction. Thank you.


-- 
View this message in context: http://www.nabble.com/EJB-access-from-remote-Stand-Alone-Client-tp18120676p18134245.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.