开发者

How do I combine @Asynchronous and Weld/CDI Events and @Observes(during=TransactionPhase.AFTER_COMPLETION) in Glassfish 3.1

First of all let me state, that the following code example worked just fine in GF 3.0.1. The troubles started when we switched to GF 3.1.

I'm using a method

@Asynchronous
public void executeFlowStep(
    @Observes(during=TransactionPhase.AFTER_COMPLETION) 
    ExecuteFlowStepEvent executeFlowStepEvent) { 

Since the switch, whenever this should receive an ExecuteFlowStepEvent I get the following error message:

WELD-000401 Failure while notifying an observer of event [package].ExecuteFlowStepEvent

No further information or stacktrace is given. It works if I remove the @Asynchronous annotation and the 开发者_JS百科AFTER_COMPLETION attribute, of course this breaks the program as I depend on the AFTER_COMPLETION timing.

I tried to ask for help on the Weld Forums, so far to no avail, although there seem to be other people with the same problem: http://seamframework.org/Community/WeldUsers

I at least would like to know: Is this a bug, or is this wanted. Does this imply that Weld does NOT work with Asynchronous methods/AFTER_COMPLETION attributes? Why did this work in GF 3.0.1? Has anyone managed to make this work on GF 3.1?


According to the link you posted as a comment to your own question, this is a bug that was fixed in Wield 1.1.2 and GlassFish 3.1.2 (build 14+).

disclamer: I posted this answer to an age old question to help SO (StackOverflow) get rid of unanswered questions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜