Posted By:
Bogdan_Odobas
Posted On:
Sunday, February 24, 2002 11:57 AM
Hey, I've got the following problem: on my machine I have the file d:Bogdansenecapwds.txt The code I'm using is: java.util.Hashtable env = new java.util.Hashtable(); env.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); env.put(javax.naming.Context.PROVIDER_URL, "file:d:\Bogdan"); env.put(javax.naming.Context.SECURITY_PRINCIPAL, "Administrator"); env.put(javax.naming.Context.SECURITY_CREDENTIALS, "myPassword"); javax.naming.Context ctx = new javax.naming.InitialContext(env); try { java.io.File f = (java.io.File) ctx.lookup("pwds.txt");
More>>
Hey, I've got the following problem:
on my machine I have the file
d:Bogdansenecapwds.txt
The code I'm using is:
java.util.Hashtable env = new java.util.Hashtable();
env.put(
javax.naming.Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.fscontext.RefFSContextFactory");
env.put(javax.naming.Context.PROVIDER_URL, "file:d:\Bogdan");
env.put(javax.naming.Context.SECURITY_PRINCIPAL, "Administrator");
env.put(javax.naming.Context.SECURITY_CREDENTIALS, "myPassword");
javax.naming.Context ctx = new javax.naming.InitialContext(env);
try {
java.io.File f = (java.io.File) ctx.lookup("pwds.txt");
System.out.println(f.getCanonicalPath());
java.util.Enumeration enum = ctx.list("seneca");
while (enum.hasMoreElements()) {
System.out.println(enum.nextElement());
}
System.out.println();
} catch (javax.naming.NamingException e) {
System.err.println(e.toString());
} finally {
ctx.close();
}
at ctx.list("seneca"); it is throwing javax.naming.NameNotFoundException error.
Could anyone tell me why?
Thanks a lot.
<<Less