如何将ear JNDI命名空间添加到EJB2.x Beans?

发布于 2024-09-08 07:38:42 字数 605 浏览 1 评论 0原文

在我目前从事的项目中,我们有大约 20 个不同的 EJB 2 JAR,它们在多个(Swing-)客户端中使用。

示例:

        customer-1.0.0.jar
          ^          ^
          |          |
   client-app-1    client-app-2

这些不同的客户端应用程序具有不同的发布周期,因此它们通常需要相同 EJB 的不同版本。同时部署这些 Bean 当然不起作用,因为它们具有相同的 JNDI 名称。根据我对 EJB 3 的经验,我认为在每个应用程序 EAR 中部署 EJB 2 bean 可以解决问题,因为 EJB 3 bean 中使用了 EAR JNDI 命名空间(例如 client-app-1/CustomerBean、client-app- 2/CustomerBean 等)。然而,EJB 2 的情况似乎并非如此。

现在,有没有一种方法可以为 EJB 2 JNDI 名称添加它们所打包的 EAR 名称空间的前缀?我知道将这些(遗留)bean 迁移到 EJB 3 将是一个答案,但我们目前没有时间这样做。

如果答案取决于应用程序服务器:我们正在使用 JBoss 4.2.3.GA。

In the project I am currently working at we have about 20 different EJB 2 JARs that are used across multiple (Swing-) clients.

Example:

        customer-1.0.0.jar
          ^          ^
          |          |
   client-app-1    client-app-2

These different client applications have different release cycles so they usually need different versions of the same EJBs. Deploying those beans simultaneously does of course not work because they have the same JNDI name. As I am experienced with EJB 3 I thought deploying the EJB 2 beans in a per-application-EAR would solve the problem as the EAR JNDI namespace is used in EJB 3 beans (e.g. client-app-1/CustomerBean, client-app-2/CustomerBean, etc.). However this seems not to be the case for EJB 2.

Now, is there a way to prefix the EJB 2 JNDI names with the namespace of the EAR they are packaged in? I know that migrating those (legacy) beans to EJB 3 would be one answer, but we currently do not have the time to do this.

If the answer is dependent on the application server: We are using JBoss 4.2.3.GA.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文