I am stuck up with this problem for quite a long time, My bean compiled and deployed properly, but when I tried to run my cleint program, I get the following Naming exception,"Unable to reslove ....". Earlier I got this same problem when I treid to call my entity bean directly from the client. So I tried to call the Entity bean from a session bean and it worked. Now I am getting this problem when I am trying to call my session bean from a client program. I am very sure I didnt change anything in my classpath whne it worked. Any thoughts?? Any response is greatly appreciated. javax.naming.NameNotFoundException: Unable to resolve SessionEJBTest. Resolved: '' Unresolved:'SessionEJBTest' ; remaining name '' at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:85) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:253) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:220) at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35) at $Proxy0.lookup(Unknown Source) at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323) at javax.naming.InitialContext.lookup(InitialContext.java:350) at com.sanjiv.ejb.prototype.factories.EJBHomeFactory.lookUpHome(EJBHomeFactory.java:46) at com.sanjiv.ejb.prototype.client.SessionEJBTestClient.<init>(SessionEJBTestClient.java:30) at com.sanjiv.ejb.prototype.client.SessionEJBTestClient.main(SessionEJBTestClient.java:108)
Thanks Sanjiv
Marcos Maia
Ranch Hand
Joined: Jan 06, 2001
Posts: 973
posted
0
Hi, if you want to recover the jndi name from some resource from a diferent VM you have to tell the component where to find the jndi name, usually you do this from a getInitialContext method, where you pass the url from the server where you want to find it, I�ll post an example from WebLogic server wich I use, take a look at your app server documentation to find out how to do it. <code> String url = "t3:localhost:7001"; private Context getInitialContext() throws NamingException {
try { // Get an InitialContext Properties h = new Properties(); h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); h.put(Context.PROVIDER_URL, url); return new InitialContext(h); } catch (NamingException ne) { log("We were unable to get a connection to the WebLogic server at "+url); log("Please make sure that the server is running."); throw ne; } } </code> regards