geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomasz Mazan <>
Subject Re: Accessing my EJB remote interface from my MDB
Date Mon, 26 Nov 2007 15:19:15 GMT

When I try to get bean existing in different ear from my MDB (deployed on
the same Geronimo) using initial context like:

  InitialContext ic = new InitialContext();
  feedbackGate = (FeedbackGateRemote) ic.lookup("CoreManagerRemote");

I get NamingException,

but if I initialize context with additional properties application is
working fine:

  Properties properties = new Properties();
  properties.setProperty(Context.PROVIDER_URL, "ejbd://localhost:4201");
  InitialContext ic = new InitialContext(properties);
  feedbackGate = (FeedbackGateRemote) ic.lookup("CoreManagerRemote");

Is it impossibly to make the first solution working ?


Jacek Laskowski wrote:
> On Nov 23, 2007 11:22 PM, Tomasz Mazan <> wrote:
>> CoreManager (session bean annotated with name "CoreManager") with @remote
>> interfaces and MDB in separated modules (jars/ears) but runs in the same
>> Geronimo 2.0.2 instance. At runtime MDB is notified what's CoreManager
>> jndi
>> name, and should get it from context.
>> 1. Is there common context for those modules / beans ?
> What do you mean by "common context"? If you think of a common JNDI
> naming space, the answer is no - they're in different ears so they
> share only a few objects common objects of Geronimo that all ears
> share and they're different Java instances.
>> 2. What's the name of CoreManager that I should pass to my MDB to get
>> proper
>> core object?
> Exactly the same you'd use from your remote client, but the difference
> lies in the JNDI properties that are not necessary. Geronimo takes
> care of it.The jndi name is earfilename/ejbname{remote} or alike (will
> have to set up an example myself).
> Jacek
> -- 
> Jacek Laskowski

View this message in context:
Sent from the Apache Geronimo - Users mailing list archive at

View raw message