How to combine @Asynchronous and Weld / CDI Events and @Observes (at = TransactionPhase.AFTER_COMPLETION) in Glassfish 3.1

First of all, let me say that the following code sample worked fine in GF 3.0.1. The problems started when we switched to GF 3.1.

I use the method

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

Since the switch, when it should turn out ExecuteFlowStepEvent , I get the following error message:

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

No further info or stacktrace. It works if I delete the @Asynchronous annotation and the AFTER_COMPLETION attribute, of course, this disrupts the program, since I depend on the time AFTER_COMPLETION .

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

At least I would like to know: Is this a mistake, or is it necessary. Does this mean that Weld does NOT work with attributes of asynchronous methods / AFTER _COMPLETION? Why does this work in GF 3.0.1? Has anyone been able to do this work on GF 3.1?

+6
source share
1 answer

According to the link that you posted as a comment on 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 old question to help SO (StackOverflow) get rid of unanswered questions.

+3
source

Source: https://habr.com/ru/post/886962/


All Articles