Name: krT82822 Date: 11/22/99
java version "1.2.2"
Classic VM (build JDK-1.2.2-001, native threads, symcjit)
I tried it in the new version (JDK 1.2.2). I still get the same problem (as in my previous report)
Also, could somebody clarify whether the user name and password have any
relevance in the fscontext provider in the JNDI framework.
(The Jndi Version is 1.2
The fscontext provider is 1.2 beta 2
I took these version numbers from the Readme.txt files form the respective
directory.)
--------------------------------------------------------------------------
Response from Sun re. my original request:
--------------------------------------------------------------------------
Re: (Review ID: 96875) UNC Paths dorsn't work in JNDI using fscontext provider
Thanks for your comments. It's not clear whether this is a JNDI-specific
issue, or a symptom of various JDK UNC-related problems. Since you're using
a fairly "old" release of the JDK, please consider re-testing this with either
the latest production version (1.2.2) or the kestrel(1.3) beta (the latter is
available from http://java.sun.com/jdc ... Early Acess area...."Java2 SDK,
v1.3 beta")
If the problem is still present in either of those releases, please re-submit
your report against one of them.
----------------- Original Bug Report-------------------
category : jndi
subcategory : cosnaming
type : bug
synopsis : UNC Paths dorsn't work in JNDI using fscontext provider
description : UNC Paths doesn't seem to work in JNDI using the fscontext (File)
Service Provider.
Here is the code:
****************************************************************
import java.io.*;
import java.net.*;
import javax.naming.*;
import javax.naming.directory.*;
import java.util.Hashtable;
class List {
public static void main(String[] args) {
// Check that user has supplied name of Directory to list
if (args.length != 1) {
System.err.println("usage: java list <DirectoryName>");
//System.exit(-1);
}
//String name = args[0]; // comment it out for now...
String name = "";
// Identify service provider to use
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.fscontext.RefFSContextFactory");
env.put(Context.PROVIDER_URL, "file:\\\\localhoast\\zipit\\");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_CREDENTIALS, "any name");
env.put(Context.SECURITY_PRINCIPAL, "any pwd");
try {
// Create the initial context
Context ctx = new InitialContext(env);
// get the directory listing...
NamingEnumeration strobj = ctx.list("");
// Print it out
while (strobj.hasMore()){
NameClassPair nc = (NameClassPair)strobj.next();
System.out.println(nc);
}
// Close the context when we're done
ctx.close();
} catch (NamingException e) {
System.err.println("Problem listing " + name + ": " + e);
}
}
}
****************************************************************
Here's the error message:
Problem listing : javax.naming.NameNotFoundException; remaining name 'E:\zipit'
Note that E:\ is the root directory of the drive from which the java program is
invoked.
Also note that I can get a directory listing if use a map drive name for the
foreign host. ie using "file:n:\\" works, but "file:\\\\foerignhost\\n_drive\\"
doesn't.
Another issue:
SECURITY_CREDENTIALS and SECURITY_PRINCIPAL doesn't seem to have any effect. In
other words, by using a different user id and password i don't seem to get
different directory listing(assuming that different users have access to
different set of files).
Thanks.
----------------- Original Bug Report-------------------
(Review ID: 97594)
======================================================================