In previous versions of JBoss EAP 6, firing a CDI event from a remote EJB client using JTS transactions resulted in a failure in invocation of transactional observers on the server.
This was fixed by correcting the JNDI namespace selection for transaction synchronization callbacks in the Weld integration code.
Transactional observers are now properly invoked in distributed transaction scenarios.
Consider following scenario:
I've got two EAP instances:
EAP1
EAP2
On EAP2 there is remote EJB "InvoiceManagerEJBHome" which has one method "fireInvoiceEvent" which fires an CDI event "InvoiceEvent"
On EAP2 there are also transactional observers methods for all transaction phases which receive event notifications during, before or after completion phase of the transaction in which the event "InvoiceEvent" was fired.
On EAP1 the remote EJB is injected (with the aid of JNDI lookup) and the method "fireInvoiceEvent" is called in container managed transaction.
JTS is used for transaction and servers are properly configured.
Expected result:
The transactional observer methods should be invoked.
Actual results:
Only one transactional observer method is invoked - for the phase IN_PROGRESS, for the rest of the phases there will appear this ERROR message in the server log of EAP2:
11:47:01,034 ERROR [org.jboss.weld.Event] (RequestProcessor-14) WELD-000401 Failure while notifying an observer of event org.jboss.as.quickstarts.cmt.jts.ejb.InvoiceEvent@564d9b1f
How reproducible:
I attached a reproducer example - it is a modified "jts" EAP quickstart
Steps to Reproduce:
1. Download the reproducer example and unzip it
2. follow the parts "Configure the JBoss Servers", "Start the JBoss servers" and "Build and Deploy the Quickstart" of the jts EAP quickstart:
http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/jts/
(no Postgres configuration is needed)
3. open the page http://127.0.0.1:8080/jboss-jts-application-component-1
4. click on the button "fire"
5. look at the server log
I think this issue should be resolved with upgrading the jbossts to 4.17.25.Final with fixing JBTM-2272.
It would be useful to backport the fix of NameNotFound Exception in the upstream WFLY-3548 PR
https://github.com/wildfly/wildfly/pull/6988 although it looks like related to the iiop thread problems. It happens if the Observer class injects the UserTransaction by JNDI "java:comp/UserTransaction"
Tom, feel free to assign the BZ to me if you think it makes sense.