WebSphere如何管理EJB jar的启动顺序? [英] How WebSphere manages startup order of EJB jars?

查看:134
本文介绍了WebSphere如何管理EJB jar的启动顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当耳朵将包含两个ejb模块modulea.jar和moduleb.jar。并且modulea.jar包含一个@Startup ejbX,它在bean X启动期间从moduleb.jar调用另一个ejbY,它不是@Startup ejb,它要求先启动moduleb.jar,否则应用服务器将无法将X注入Y。但是如何确保moduleb.jar首先启动?

When an ear would contain two ejb modules modulea.jar and moduleb.jar. And modulea.jar contains an @Startup ejbX, that calls another ejbY, which is not an @Startup ejb, from moduleb.jar during the startup of the bean X it is required that moduleb.jar is started first as otherwise the app server is not able to inject X into Y. But how to ensure that moduleb.jar is started first?

当前我在WebSphere中遇到了这个问题,但是我似乎无法找到一种执行命令的方法。规范中是否有某些东西可以管理订单?

Currently I have this problem in WebSphere, but I can't seem to find a way to enforce an order. Is there something in the spec to manage order?

或者可能是特定于WebSphere的(尽管没有供应商锁定)。也许有一个启动ejb和它在不同模块中使用的ejb是一个糟糕的设计,对此也有一些见识。

Or maybe WebSphere specific (rather not have vendor lock in though). Maybe it is a poor design to have a startup ejb and an ejb that is used by it in different modules, some insight about that is also welcome.

推荐答案

可以通过模块配置中的起始重量进行配置(企业应用程序> YourApplication>管理模块> ejbmoduleb.jar

It is possible to configure it via Starting weight in the module configuration (Enterprise Applications > YourApplication > Manage Modules > ejbmoduleb.jar)


起始重量

指定启动服务器
时模块的启动顺序。

Specifies the order in which modules are started when the server starts. The module with the lowest starting weight is started first.

如果需要整个应用程序之间的订单依存关系,则设置 启动行为应用程序配置中的<启动顺序企业应用程序> YourApplication>启动行为

If you need order dependency among whole applications, you set Startup order in the Startup behavior application configuration (Enterprise Applications > YourApplication > Startup behavior)


启动订单

指定服务器
启动时启动应用程序的顺序。启动顺序就像一个起始重量。首先启动具有最低起始权重的应用程序

Specifies the order in which applications are started when the server starts. The startup order is like a starting weight. The application with the lowest starting weight is started first.

如果您打算使用应用程序.xml 部署描述符将以下条目添加到描述符中,并以正确的顺序提供模块。

If you plan to have application.xml deployment descriptor add the following entry to the descriptor and provide modules in the correct order.

<initialize-in-order>true</initialize-in-order>

另请参见:

  • EJB module settings
  • Application startup behavior

这篇关于WebSphere如何管理EJB jar的启动顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆