在 OpenEJB 嵌入模式下使用 JNDI 属性文件
尽管 jndi 属性文件保留在类路径中,但它不会加载,并且在 ANT 中的 JVM 参数中配置 JNDI 属性时,它工作正常。
<jvmarg value="-Djava.naming.factory.initial=org.openejb.client.LocalInitialContextFactory"/>
如何通过属性配置 JNDI,以便即使
在 EJB 中使用 Context=new InititalContext() 时,也需要加载在属性中配置的 JNDI 属性。
谢谢,
Velmurugan R
Eventhough the jndi properties file is kept in the classpath its not loaded and JNDI properties when configured in JVM arguments in ANT its working fine.
<jvmarg value="-Djava.naming.factory.initial=org.openejb.client.LocalInitialContextFactory"/>
How to configure the JNDI thorugh properties so that even when
Context=new InititalContext() is used in the EJB's the JNDI properties that are configured in properties needs to be loaded.
Thanks,
Velmurugan R
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
务必确保 jndi.properties 文件位于类路径的根目录中,而不是位于 META-INF/ 目录或任何其他位置。我所说的 root 是指与 META-INF/ 所在位置平行的某个目录。例如:
该文件由 JVM 本身处理,因此如果它不起作用,很可能与它不在类路径上有关正确。
Definitely make sure the jndi.properties file is at the root of the classpath and not in a META-INF/ directory or any other location. By root, I mean some directory that is parallel to a where a META-INF/ would be. For example:
That file is processed by the JVM itself, so if it doesn't work, odds are it is related to it not being on the classpath correctly.