Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个使用 JNDI 的应用程序,它首先工作,在我创建一个新项目后,由于与 SVN 冲突,它现在抛出 NoInitialContextException。
这是它抛出的异常:
NoInitialContextException:需要在环境或系统属性中指定类名,或作为小程序参数,或在应用程序资源文件中:java.naming.factory.initial
另一个小组的同类项目仍然有效。
确保您在类路径中的某处有 jndi.properties 文件(您可能在冲突后删除/损坏了该文件)。
此文件定义 JNDI 绑定的 InitialContext。