posted 18 years ago
Vijay,
I guess some thing may wrong in the Initial context look-up.
Here what you did
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
env.put (Context.PROVIDER_URL, "iiop://localhost:3700");
please look for the port number 3700 is correct? did you use default port while creating your domain? or did you mention 3700?
usually default would be 7001 ..so try with that if you want to..
In WebLogic
JNDI_FACTORY= "weblogic.jndi.WLInitialContextFactory";
url = "t3://localhost:7001";
env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
env.put(Context.PROVIDER_URL, url);
and one more thing is ..if you are client also running on the same box, then you can use default way also
lets say
Context jndiContext = null;
try
{
jndiContext = new InitialContext();
Object o = jndiContext.lookup("AdviceBean");
AdviceHome home = (AdviceHome)PortableRemoteObject.narrow (o, AdviceHome.class);
Advice = AdviceHome.create();
try this ...
Thanks,
Ugender
[ August 16, 2006: Message edited by: Ugender Rekulampally ]