users@glassfish.java.net

Re: Ejb default name in JNDI

From: Wouter van Reeven <wouter_at_van.reeven.nl>
Date: Wed, 29 Nov 2006 13:16:48 +0100

On Wed, Nov 29, 2006 at 12:31:09PM +0100, Filippo Diotalevi wrote:
> I'm trying to find in the specification document what's the default
> name assigned to an EJB in the JNDI register when no-one is specified,
> but I don't see a clear answer.
> F.i., I have a stateless ejb
> ----
> package org.acme;
> @Remote
> public interface Calculator { ...}
> ----
> package org.acme;
> @Stateless
> public class CalculatorImpl implements Calculator { .. }
> ----
> what will be its name in the JNDI register?

In Glassfish it will be the full name of the remote sessionbean class. In your
case

org.acme.Calculator

You can look it up with

InitialContext ic = new Initialcontext();
Calculator calc = ic.lookup(Calculator.class.getName());


HTH, Wouter van Reeven

-- 
People: "If she weighs the same as a Duck, she's made of wood!"
Sir Bedevere: "And therefore...?"