为什么我写的JNDI程序总要报错,哪位高手帮忙看下
Problem: javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory]

解决方案 »

  1.   

    com.sun.jndi.fscontext.RefFSContextFactory
      这个类找不到ClassNotFoundException
      

  2.   

    需要去http://java.sun.com/products/jndi/downloads/index.html下载相应的JNDI包加入classpath
      

  3.   

      楼主 我知道了。。
      你用的是EJB 服务器是Jboss(常出现这个问题)
      解决方案: 
        1,查看项目的包。。
         2,检测jndi.properties配置文件是否有拼写错误..
        3,注意字符串两头的空格(最致命的)
        4,把JBOSS下client下的所有的包都导入到你的客户端项目里。
      
       参考:http://www.cnblogs.com/dongritengfei/archive/2009/10/27/1590883.html