请教jndi的问题!

ychcai 04-07-28

package jndi;

import java.util.*;
import javax.naming.*;

public class Lookup {
public static void main(String[] args) {
String name = "";
if (args.length != 0)
name = args[0];

try {
// Create a Properties object and set properties appropriately
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.fscontext.RefFSContextFactory");
env.put(Context.PROVIDER_URL, "file:/tmp/tutorial");
Context ctx = new InitialContext(env);


// Look up the object
Object obj =ctx.lookup(name);
if (name.equals(""))
System.out.println("Looked up the initial context");
else
System.out.println(name + " is bound to: " + obj);
}
catch (NamingException nnfe) {
System.out.println(nnfe);
}
}
}
运行后显示:javax.naming.NoInitialContextExcption: can not instantiate class:com.sun.jndi.fscontext.RefFSContextFactory.

我的JDK版本是1.4,而且已经把文件服务供应器的.jar文件拷贝到java-home/jre/lib/ext目录下。

请问出了什么问题,谢谢!