Given the following EJB3 session bean, deployed to Geronimo v2.1:
@Stateless(name="MyCatalogEJB")
public class MyCatalogEJBImpl implements CatalogEJB {
...
}
Having been able to lookup that EJB from a J2SE client as follows:
Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.RemoteInitialContextFactory");
properties.setProperty(Context.PROVIDER_URL,
"ejbd://localhost:4201");
InitialContext context = new InitialContext(properties);
CatalogEJB catalog = (CatalogEJB)
context.lookup("java:CatalogEJBRemote");
I would like to look it up using CosNaming, something like that:
InitialContext context = new InitialContext();
CatalogEJB catalog = (CatalogEJB)
context.lookup("corbaname:iiop:[EMAIL PROTECTED]:1050#CatalogEJBRemote");
but whatever name I try I always get the same exception:
Exception in thread "main" javax.naming.NameNotFoundException [Root
exception is org.omg.CosNaming.NamingContextPackage.NotFound:
IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
at
com.sun.jndi.cosnaming.ExceptionMapper.mapException(ExceptionMapper.java:44)
at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:484)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:523)
at
com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at client.Client.main(Client.java:24)
Caused by: org.omg.CosNaming.NamingContextPackage.NotFound:
IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
at
org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
at
org.omg.CosNaming._NamingContextStub.resolve(_NamingContextStub.java:251)
at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:470)
... 4 more
Any idea of what I'm missing? Thanks.
--
Jean-Sebastien