This is a discussion on Can't lookup an EJB 3.0 bean using corbaname or corbaloc syntax - Websphere ; I can't access my EJB 3.0 bean from another WAS server (standalone server not part of the same cell). I've deployed a simple EJB 3.0 bean to one WAS 6.1 (EJB Feature Pack with FixPack 23), which starts ok, and ...
I can't access my EJB 3.0 bean from another WAS server (standalone server not part of the same cell).
I've deployed a simple EJB 3.0 bean to one WAS 6.1 (EJB Feature Pack with FixPack 23), which starts ok, and I can access the bean if calling it from the same JVM / WAS. In the SystemOut.log, I can see the message:
CNTR0167I: The server is binding the CustomerEJBRemote interface of the CustomerEJB enterprise bean in the CustomerEJB.jar module of the CustomerEAR application. The binding location is: ejb/CustomerEAR/CustomerEJB.jar/CustomerEJB#customer.CustomerEJBRemote
When I run the dumpNameSpace.bat file, I can also see the the bean appears to be bound in the JNDI namespace
I've tried several ways of looking this bean up but have all failed with a NameNotFound error. Here's the URLs I've tried (note the '%5c' is just an escape character for '\' which is required for the dot '.'). I have tried escaping and non-escaping the '.'.
I can successfully bind to and lookup the following contexts, but when I list attributes underneath, my CustomerEAR and CustomerEJB do not appear - almost as though I'm looking in the wrong NameService (I promise you I'm not).
The code below fails with the error "javax.naming.NameNotFoundException: Context: HOMENode01Cell/nodes/HOMENode01/servers/server1, name: ejb/CustomerEAR/CustomerEJB.jar/CustomerEJB#customer.CustomerEJBRemote: First component in name CustomerEAR/CustomerEJB.jar/CustomerEJB#customer.CustomerEJBRemote not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDLmg.org/CosNaming/NamingContext/NotFound:1.0]"
Properties p =new Properties();
String iiopAddress = "corbaloc:iiop:localhost:2809/NameService"; // this is the bootstra port#
InitialContext ic = new InitialContext(p);
Object ref = ic.lookup(jndiName);