cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to perform jndi lookup of home interface across servers

Former Member
0 Kudos

I have two separate installations of SAP EE5 on two separate physical machines. On machine A, I have application ear1 that tries to get the home interface of a bean residing on machine B in application ear2. I am using the following code:

Context ctx = null;

Hashtable env = new Hashtable(5);

env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");

env.put(Context.PROVIDER_URL, "B:50004");

ctx = new InitialContext(env);

Object o = ctx.lookup("turtle.registry.SBRegistryRemoteHome");

I get a NameNotFoundException. SAP does not seem to actually be trying to connect to machine B. On machine B, I turned on com.sap.engine.services.cross and I do not see any communication in defaultTrace.0.trc. However, if I setup a simple standalone java client that essentially does the same thing from a different box, I do see alot of logging related to communication occuring on machine B. Is there something else I need to do?

One other thing to note is that when I run app1.ear on machine B within the same instance of SAP I am able to get the remote home so I don't believe it is my jndi name. Unless the jndi name needs to be different when accessing from a different box. But that still does not explain why I do not see any communication related logging when trying to connect from machine A. Below is the actual stack trace which I believe confirms it is not actually communicating with machine B:

com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of turtle.registry.SBRegistryRemoteHome.

at com.sap.engine.services.jndi.implserver.ServerContextImpl.lookup(ServerContextImpl.java:650)

at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:344)

at com.sap.engine.services.jndi.implclient.OffsetClientContext.lookup(OffsetClientContext.java:266)

at com.sap.engine.services.jndi.implclient.OffsetClientContext.lookup(OffsetClientContext.java:286)

at javax.naming.InitialContext.lookup(InitialContext.java:351)

at javax.naming.InitialContext.lookup(InitialContext.java:351)

at turtle.common.server.connect.RemoteFactory.getRemote(RemoteFactory.java:90)

at turtle.common.server.connect.RemoteProxyFactory.getRemote(RemoteProxyFactory.java:99)

at turtle.common.server.connect.RemoteProxyFactory.create(RemoteProxyFactory.java:91)

at turtle.common.server.connect.RemoteProxyFactory.createProxy(RemoteProxyFactory.java:52)

at turtle.server.runtime.registry.RegistryFacade.connectToRegistry(RegistryFacade.java:818)

at turtle.server.runtime.registry.RegistryFacade.getRegistryBI(RegistryFacade.java:873)

at turtle.server.runtime.registry.RegistryFacade.bind(RegistryFacade.java:544)

at turtle.registry.ProjectRegistrar$1$1.run(ProjectRegistrar.java:128)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAs(Subject.java:337)

at turtle.common.security.auth.AuthenticatorBase.doAs(AuthenticatorBase.java:343)

at turtle.registry.ProjectRegistrar$1.run(ProjectRegistrar.java:162)

at java.util.TimerThread.mainLoop(Timer.java:512)

at java.util.TimerThread.run(Timer.java:462)

Am I doing something wrong? Do I need to do something special from a j2ee application to have it communicate with jndi from another j2ee engine on another box?

Accepted Solutions (0)

Answers (1)

Answers (1)

Vlado
Advisor
Advisor
0 Kudos

Hi Jay,

This scenario is a known limitation of the Java EE 5 preview server and will be supported in the official product release. Unfortunately, there is no workaround that can be applied in the preview.

Cheers,

Vladimir

Former Member
0 Kudos

Thanks for the quick response. At least that will save me alot of time (and hair) trying to figure out what is wrong.

Former Member
0 Kudos

Vladimir,

Is there somewhere on the SAP website that has a list of known limitations for the Java EE 5 preview? Specifically I am looking for a description of this particular limitation. Or can you provide a more in depth explanation of the exact limitation encountered in this post?

Also, do you know if updated preview versions will be made available when known limitations become supported?

Thanks,

Jay

Vlado
Advisor
Advisor
0 Kudos

Hi Jay,

The limitation is exactly what you have observed: a client running on server A cannot lookup an EJB that resides on a remote server B; only EJBs on the same server can be looked up. There is no issue with the lookup from standalone remote clients (i.e. not running on a server). And as I said before, this will be supported in the official release of <a href="http://www.sap.com/company/press/press.epx?pressid=6705">SAP NetWeaver Composition Environment</a>.

Unfortunately at present I cannot answer your question about updated preview versions.

Cheers,

Vladimir