当应用程序名称包含句点时出现 NameNotFoundException

发布于 2024-09-29 03:48:01 字数 834 浏览 1 评论 0原文

我有一个简单的 EJB 应用程序,大约 6 个月前可以运行。当我遇到这个问题时,我安装了最新的 JDeveloper (11.1.1.3.0),并试图让它再次工作。

部署在这一行失败:

TeacherManager teacherManager = (TeacherManager)context.lookup("Uran_2.0-TeacherManager#hu.elte.pgy2.BACNAAI.UranEJB.TeacherManager");

带有消息(由我强调):

javax.naming.NameNotFoundException:尝试查找“Uran_2.0-TeacherManager#hu.elte.pgy2.BACNAAI.UranEJB.TeacherManager”时未找到子上下文“Uran_2”。已解决 '' [根异常是 javax.naming.NameNotFoundException:尝试查找 'Uran_2.0-TeacherManager#hu.elte.pgy2.BACNAAI.UranEJB.TeacherManager' 时未找到子上下文 'Uran_2'。已解决'']; 剩余名称“Uran_2/0-TeacherManager#hu/elte/pgy2/BACNAAI/UranEJB/TeacherManager

显然应用程序的名称(Uran_2.0)以某种方式提示 JDeveloper(或 JNDI?我不确定)将名称中的 . 替换为 /,这显然会导致 JNDI 查找失败。我该如何解决这个问题?

I have a simple EJB app that used to work about 6 months ago. I installed the latest JDeveloper (11.1.1.3.0) and I'm trying to get it to work again, when I ran into this problem.

Deployment fails on this line:

TeacherManager teacherManager = (TeacherManager)context.lookup("Uran_2.0-TeacherManager#hu.elte.pgy2.BACNAAI.UranEJB.TeacherManager");

With the message (emphasis by me):

javax.naming.NameNotFoundException: While trying to lookup 'Uran_2.0-TeacherManager#hu.elte.pgy2.BACNAAI.UranEJB.TeacherManager' didn't find subcontext 'Uran_2'. Resolved '' [Root exception is javax.naming.NameNotFoundException: While trying to lookup 'Uran_2.0-TeacherManager#hu.elte.pgy2.BACNAAI.UranEJB.TeacherManager' didn't find subcontext 'Uran_2'. Resolved '']; remaining name 'Uran_2/0-TeacherManager#hu/elte/pgy2/BACNAAI/UranEJB/TeacherManager'

Apparently the application's name (Uran_2.0) somehow prompts JDeveloper (or JNDI? I'm not sure) to replace the . in the name with a /, which obviously causes the JNDI lookups to fail. How can I get around this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

妞丶爷亲个 2024-10-06 03:48:01

您的无状态/有状态 EJB 应显式指定 JNDI 名称:

@Stateless(mappedName = ?)

如果这不起作用,您可以使用 context.list("")浏览 jndi 树以查看部署了哪些远程 EJB。

Your Stateless/Stateful EJB should explicitly specified the JNDI name :

@Stateless(mappedName = ?)

If this doesn't work, you can use context.list("") to browse the jndi tree in order to see what remote EJB are deployed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文