Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unable to Lookup EJB Home Through JNDI

0 views
Skip to first unread message

Bill R.

unread,
Apr 9, 2002, 6:45:42 PM4/9/02
to
Hi,

I have a client that calls a single stateless session bean. When I run this on the
local WL server, everything works fine. When I try to run this with the EJB deployed
on a different computer, it keeps failing. The Weblogic 7.0beta installation is
identical for both computers.

Here is the code for the client lookup:

private TestDBHome lookupHome() throws NamingException
{
log("inside lookupHome");

// Lookup the beans home using JNDI
Context ctx = getInitialContext();
log("step 2 of lookupHome");

try {
Object home = ctx.lookup("TestDBBean");
log("step 3 of lookupHome");
return (TestDBHome) narrow(home, TestDBHome.class);

} catch (NamingException ne) {
log("The client was unable to lookup the EJBHome JNDI_NAME.");
throw ne;
}
}

It obtains the initial context fine. When it gets to the ctx.lookup("TestDBBean"),
it throws the error:

javax.naming.NameNotFoundException: Unable to resolve 'TestDBBean' Resolved: ''
Unresolved:'TestDBBean' ; remaining name
'TestDBBean'
at
weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:109)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:261)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:228)
at weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:338)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:333)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at TestDBClient.lookupHome(TestDBClient.java:166)
at TestDBClient.<init>(TestDBClient.java:42)
at TestDBClient.main(TestDBClient.java:87)


If someone has any suggestions or could point out what I am over looking, I would
greatly appreciate it.

Thanks,

Bill

Gaurav Khanna

unread,
Apr 9, 2002, 7:23:08 PM4/9/02
to
It seems to me that you need to specify the url, host of the remote server
when you build the context
.

Something like this
Stringt urlOfHost = "t3://abc.com:7001";
// Get an InitialContext
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, urlOfHost);
Context ctx = new InitialContext(h);


"Bill R." <bru...@tripos.com> wrote in message
news:3CB36F16...@tripos.com...

0 new messages