Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Error creating jndi context

Hi,

I'm trying to connect to a weblogic server using the following code:

Context ctx = null;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY ,"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL,"t3://10.113.46.110:27110");
ht.put(Context.SECURITY_PRINCIPAL,"System");
ht.put(Context.SECURITY_CREDENTIALS,"vignette");

try {
ctx = new InitialContext(ht);
// Use the context in your program
}
catch (NamingException e) {
returnVal= "namingexception"+e.getMessage();
//return returnVal;
}
finally {
try {ctx.close();}
catch (Exception e) {
returnVal= "Exception"+e.getMessage();
}

When trying to create an initialContext I get the following error:

javax.naming.NameNotFoundException: Name com.vignette.as.client.ejb.ObjectTypeOps is not bound in this Context.

I've been trying to understand what this error means but I havent been successful.

I have an inkling that I'm not connecting to the server properly but I do not know how to check whether my configuration information is correct. Is anyone able to spot any glaring errors or does someone know how to test that a server is running.
[1387 byte] By [humz] at [2007-11-11 8:45:00]
# 1 Re: Error creating jndi context
Have u tried without the security prinicpals and credentials?
Angel106 at 2007-11-11 23:34:46 >
# 2 Re: Error creating jndi context
Thanks for the reply,

The error was related to some vendor software I was using. Additional configuration was required with their software before logging in.
humz at 2007-11-11 23:35:52 >