【问题标题】:JBOSS Asynchronus transactional method call AFTER_COMPLETION event - WELD-000401JBOSS 异步事务方法调用 AFTER_COMPLETION 事件 - WELD-000401
【发布时间】:2016-08-22 12:05:24
【问题描述】:

我调用异步事务方法并观察事务提交事件。方法成功结束,但我收到的不是执行 onTransactionCommit 方法:

WELD-000401 Failure while notifying an observer of event

JBoss EAP 6.4.0.GA (AS 7.5.0.Final)

Hire 是我的代码模板:

public class WeldExceptionProblemTest {
    @Asynchronous
    public void asynchMethod() {
    }
    public void onTransactionCommit(@Observes(during = TransactionPhase.AFTER_COMPLETION) TestEvent event) {
    }
    private class TestEvent {
    }
}

【问题讨论】:

标签: jakarta-ee asynchronous jboss cdi weld


【解决方案1】:

在 asynchMethod 中使用 try...catch(RuntimeException) 块。我有一个例外。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-28
    • 1970-01-01
    • 2015-03-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多