我目前正在尝试将我的 Web 应用程序从 jboss 5.1 升级到 jboss 7.1.1.Final
在我的 jboss.xml 中,我配置了一些自定义 ejb 超时,如下所示:
<session>
<ejb-name>MSServiceEJB</ejb-name>
<jndi-name>ejb/MSServiceEJB</jndi-name>
<local-jndi-name>ejb/LocalMSServiceEJB</local-jndi-name>
<method-attributes>
<method>
<method-name>*</method-name>
<transaction-timeout>3600</transaction-timeout>
</method>
</method-attributes>
</session>
jboss 7 忽略 jboss.xml,我在哪里可以指定我的 ejb 2.1 事务超时?
最佳答案
每
替换jboss.xml部署描述 rune 件
The jboss-ejb3.xml deployment descriptor replaces the jboss.xml deployment descriptor to override and add to the features provided by the Java Enterprise Edition (EE) defined ejb3-jar.xml deployment descriptor. The new file is incompatible with jboss.xml, and the jboss.xml is now ignored in deployments.
您需要创建一个jboss-ejb3.xml
并将配置放入其中。
它看起来像这样:
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>EJBName</ejb-name>
<method-name>methodName</method-name>
<method-intf>Local</method-intf>
</method>
<tx:trans-timeout>
<tx:timeout>500</tx:timeout>
<tx:unit>Seconds</tx:unit>
</tx:trans-timeout>
</container-transaction>
</assembly-descriptor>
您正在使用 EJB2.x
,因此最好在 ejb-jar.xml
中配置它
它应该在 EJB jar 的 META-INF
中创建。
关于jboss7.x - Jboss 7.1 ejb 2.1自定义事务超时配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13015280/