简体   繁体   English

EJB + Web应用程序(JBoss 5)是否需要jndi.properties文件?

[英]Is the jndi.properties file required for a EJB + web application (JBoss 5)?

In a JBoss 5 JEE project which I have inherited, the web application (WAR) project contains a JNDI configuration file which seems to be unneccessary. 在我继承的JBoss 5 JEE项目中,Web应用程序(WAR)项目包含一个似乎不必要的JNDI配置文件。 Its content is 其内容是

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost:1099

Removing it has no obvious effect, deployment and execution works well and unit tests show no errors. 删除它没有明显的效果,部署和执行效果很好,并且单元测试没有错误。

Is it safe to delete this file? 删除此文件安全吗?

You would create that file if you want to create a -client- that connects to a JNDI context to invoke EJBs remotely. 如果要创建连接到JNDI上下文的-client-来远程调用EJB,则可以创建该文件。 If that war is part of the application that serves the EJB, you indeed do not need it since you already have local access to the JNDI context. 如果那场战争是服务EJB的应用程序的一部分,那么您确实不需要它,因为您已经可以本地访问JNDI上下文。 Assuming the war is part of an EAR that also holds the EJB module. 假设战争是EAR的一部分,EAR也拥有EJB模块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM