Hi everyone
I wrote the jndi program .Its compiled ok when i run this pgm i got the following exception.
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.Hashtable;
class Lookup {
public static void main(
String[] args) {
// Check that user has supplied name of file to lookup
if (args.length != 1) {
System.err.println("usage:
java Lookup <filename>");
System.exit(-1);
}
String name = args[0];
// Identify service provider to use
Hashtable env = new Hashtable(11);
System.out.println("::::::::"+env);
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.fscontext.RefFSContextFactory");
try {
Context ctx = new InitialContext(env);
System.out.println("context is :"+ctx);
Object obj = ctx.lookup(name);
System.out.println("Object is :"+obj);
System.out.println(name + " is bound to: " + obj);
ctx.close();
} catch (NamingException e) {
System.err.println("Problem ******* looking up " + name + ": " + e);
}
}
}
Exception;
-----------
Problem ******* looking up \fx.bat: javax.naming.NoInitialContextException: Cann
ot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception
is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory
]
Note:
Here i got the pbm this progrsm i think
(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.fscontext.RefFSContextFactory
I mean com.sun.jndi.fsc.........
So how can i find out whethere the parameter is there or not i mean com.sun.jndi.fscontext.RefFSContextFactory
so any body advise...........