问题
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 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?
回答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.
来源:https://stackoverflow.com/questions/5832775/how-do-i-combine-asynchronous-and-weld-cdi-events-and-observesduring-transact