JBoss-AS7 @TransactionTimeout:缺少Maven依赖项 [英] JBoss-AS7 @TransactionTimeout: Missing Maven dependency
问题描述
我正在使用 JBoss AS 7.1.1.Final"Brontes" ,并且在@Stateless
-Bean中遇到了长时间运行的方法调用
5分钟后取消:
[com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117:
TransactionReaper::check timeout
搜索此问题,我找到了一些答案 JBoss-AS7参考指南或 JBoss Wiki .>
答案似乎很简单:用@TransactionTimeout
注释方法
但是:该课程在我的课程路径中不可用!
我有一个具有EAR结构的Maven项目,并且ejb
模块具有以下相关依赖关系,我在大量使用EJB3的多个项目中使用了这些依赖关系:
-
org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec
(提供) -
javax.enterprise:cdi-api
(提供) -
org.hibernate.javax.persistence:hibernate-jpa-2.0-api
(提供) -
org.hibernate:hibernate-validator
(提供)
缺少哪个依赖项?
尝试一下;进行了相当认真的搜索才能发现它,但似乎应该可以:
<dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-ext-api</artifactId>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>
GitHub:
- https://github.com/jbossejb3/jboss-ejb3-ext-api
- https ://github.com/jbossejb3/jboss-ejb3-ext-api/blob/master/src/main/java/org/jboss/ejb3/annotation/TransactionTimeout.java
我认为Petr发现的是较旧的一个(最初是针对JBoss 4.2.x);如Thor所言,它不包含unit参数,并且可能不适用于AS7.
对于任何更新 JBAS7 EJB参考指南的人来说都是卑微的建议.也许可以包含@TransactionTimeout的Maven详细信息?
I'm using JBoss AS 7.1.1.Final "Brontes" and encountering a long running method call in a @Stateless
-Bean
which is cancelled after 5 Minutes:
[com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117:
TransactionReaper::check timeout
Searching for this issue I've found some answers Jboss 7.1 ejb 2.1 custom transaction timeout configuration and wikis JBoss-AS7 reference guide or JBoss Wiki.
The answer seems to be simple: Annotate the method with @TransactionTimeout
But: This class is not available in my classpath!
I have a Maven project with an EAR structure and the ejb
module has the following relevant dependencies which I use in several projects with heavy usage of EJB3:
org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec
(provided)javax.enterprise:cdi-api
(provided)org.hibernate.javax.persistence:hibernate-jpa-2.0-api
(provided)org.hibernate:hibernate-validator
(provided)
Which dependency is missing?
Try this one; it took some pretty serious searching to unearth it, but it seems like it should work:
<dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-ext-api</artifactId>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>
GitHub:
- https://github.com/jbossejb3/jboss-ejb3-ext-api
- https://github.com/jbossejb3/jboss-ejb3-ext-api/blob/master/src/main/java/org/jboss/ejb3/annotation/TransactionTimeout.java
I think that the one Petr found is the older one (originally for JBoss 4.2.x); as Thor mentioned, it doesn't include the unit parameter, and may not work with AS7.
A humble suggestion for whomever updates the JBAS7 EJB reference guide; maybe the Maven details for @TransactionTimeout could be included?
这篇关于JBoss-AS7 @TransactionTimeout:缺少Maven依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!