geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ueberbach, Michael" <>
Subject AW: ejb client jndi problem
Date Fri, 21 Sep 2007 13:35:09 GMT

I don't know exactly your situation, please check the following conditions:   
- you deployed a EJB 3.0 application in an xxx-ejb.jar
- you configured an openejb-jar.xml deployment plan where you set an artifactId for your app,
let's say "MyApp"
- you have a session bean you want connect to, let's say "MySessionBean"
- you have build a remote interface for your session bean (EJB 3.0 means a simple interface),
let's say "MySessionRemote"

then the following is the right jndi name to get a connection to your bean


You have to use the fully qualified class name for the Interface!


-----Urspr√ľngliche Nachricht-----
Von: wanyna [] 
Gesendet: Freitag, 21. September 2007 11:47
Betreff: ejb client jndi problem

I deploy ejb jar in geronimo2.0.1, this is a ejb2 test
simple-ejb2-1.0.jar , and this is a ejb3 test
simple-ejb3-1.0.jar .

Both of them deploy no error.

My client is a standalone application. Test code:
public class ClientTest {

	public static EchoRemote getEchoService(String url,
			String contextFactory) throws Exception {
		Context context = getInitialContext(contextFactory, url);
		Object obj = context.lookup("Echo");
		return (EchoRemote) obj;

	public static CounterRemote getCounterService(String url,
			String contextFactory) throws Exception {
		Context context = getInitialContext(contextFactory, url);
		Object obj = context.lookup("SuperCounterBusinessRemote");
		return (CounterRemote) obj;

	private static Context getInitialContext(String initContextFactory,
			String url) throws Exception {
		Properties properties = new Properties();
		properties.put(Context.INITIAL_CONTEXT_FACTORY, initContextFactory);
		properties.put(Context.PROVIDER_URL, url);

		return new InitialContext(properties);
	public static void main(String[] args) throws Exception{
		String url = "ejbd://localhost:4201";
		String factory = "org.openejb.client.RemoteInitialContextFactory";
		EchoRemote echo = getEchoService(url, factory);
//		CounterRemote counter = getCounterService(url, factory);
//		assert(counter.reset()==0);
//		assert(counter.increment()==1);
//		assert(counter.increment()==2);
//		assert(counter.reset()==0);


Exception in thread "main" javax.naming.NameNotFoundException: /Echo does not exist in the
system.  Check that the app was successfully deployed.
	at org.apache.openejb.client.JNDIContext.lookup(
	at javax.naming.InitialContext.lookup(
	at test.ClientTest.getEchoService(
	at test.ClientTest.main(

What's the right jndi name?

I see some other messages talk about ejb jndi, but still can't resolve my problem.

I deploy ejb2 test in geronimo 1.x, client lookup no problem. 
View this message in context:
Sent from the Apache Geronimo - Users mailing list archive at

View raw message