Tomcat5使用JNDI在javabean出现javax.naming.NoInitialContextException:Need to speci

异常信息:javax.naming.NoInitialContextException:Need to specify class name in environment or system

异常信息:
  javax.naming.NoInitialContextException:
  Need to specify class name in environment or system property,
  or as an applet parameter, or in an application resource file:
  java.naming.factory.initial
 
  是环境没配置对?JNDI和web.xml都配置了啊

------解决方法--------------------------------------------------------
参见:
  http://blog.csdn.net/kingapex1/archive/2004/07/15/42050.aspx
------解决方法--------------------------------------------------------
  应该是初始化方法:
 
  1种 用参数,如:
  Hashtable env = new Hashtable();
  env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory");
  ....
  Context ctx = new InitialContext(env);
 
  2 用配置文件,缺省jndi.properties。(好像新规范要用xml,我不确定),如:
  Context.INITIAL_CONTEXT_FACTORY="com.sun.jndi.fscontext.RefFSContextFactory"