Hi
I get the following error when I try to access a session bean through a client program:
java.lang.NoClassDefFoundError: javax/naming/InitialContext
The part of code that gives the error is:
public Object doLookup(
String homeObject,String homeClass) throws NamingException,RemoteException{
Context ctx = null;
Object obj = null;
Properties p = new Properties();
System.out.println("inside method doLookup");
p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
System.out.println("after statement initial_context_factory");
p.put(Context.PROVIDER_URL,"t3://localhost:7001");
System.out.println("after statement provider_url");
ctx = new InitialContext(p);
System.out.println("after statement new InitialContext");
try{
obj = javax.rmi.PortableRemoteObject.narrow(ctx.lookup(homeObject),Class.forName(homeClass));
}catch(ClassNotFoundException e){
throw new RemoteException("Session "+e.getMessage());
}catch(Exception e){
throw new RemoteException("Session Exception "+e.getMessage());
}
return obj;
}
}
The jar files(one session and one entity) have been created and installed on the weblogic server without any problem.
The import statements are:
import javax.naming.*;
import java.rmi.*;
import java.util.Hashtable;
import java.util.Properties;
The statement where the error comes is:
ctx = new InitialContext(p);
I am using weblogic 5.1.0 and jdk1.2.2.
Can anybody help?
[This message has been edited by Rishi K (edited October 04, 2000).]