WildFly 14 - Problems with RequestScope in MDB
munzi82 Jan 7, 2019 11:14 AMHi all,
We have an application where some MDBs are running.
From time to time we run into the following problem when executing tests (the application is not yet in production so I cannot say if these problems also occur in the "real" application):
2019-01-07 15:40:43,949 ERROR [org.jboss.as.ejb3.invocation] (Thread-8 (ActiveMQ-client-global-threads)) WFLYEJB0034: EJB Invocation failed on component PlanningContextDeletedSubscriber for method public void com.fntsoftware.lib.platform.boundary.MSIBaseSubscriber.onMessage(javax.jms.Message): java.util.ConcurrentModificationException at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1498) at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1521) at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.contexts.AbstractContext.destroy(AbstractContext.java:152) at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.contexts.AbstractManagedContext.deactivate(AbstractManagedContext.java:59) at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.contexts.AbstractBoundContext.deactivate(AbstractBoundContext.java:73) at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.module.ejb.context.EjbRequestContextImpl.deactivate(EjbRequestContextImpl.java:50) at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:85) at org.jboss.as.weld.common@14.0.1.Final//org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:89) ...
I created a listener for the RequestScoped events and this is the output for the request above:
2019-01-07 15:40:43,875 SEVERE [com.fntsoftware.cmdnxg.orders.order.Listener] (Thread-8 (ActiveMQ-client-global-threads)) Request context initialized for EJB invocation 2019-01-07 15:40:43,904 SEVERE [com.fntsoftware.cmdnxg.orders.order.Listener] (Thread-8 (ActiveMQ-client-global-threads)) Request context is about to be destroyed after EJB invocation 2019-01-07 15:40:43,947 SEVERE [com.fntsoftware.cmdnxg.orders.order.Listener] (Thread-8 (ActiveMQ-client-global-threads)) Request context destroyed after EJB invocation
But after the exception above the code in AbstractEJBRequestScopeActivationInterceptor always handles the case that the context is active although it is a new request (re-delivery of JMS message). And then it crashes with a NullPointerException in the RequestScoped beans.
The strange part is that it depends on the version number of our application e.g. with version 1.16.0 there is no problem. With 1.17.0 all tests fail with these problems.
Unfortunately I can't provide a running application to reproduce this problem.
Any ideas what can cause these problems!? Or maybe some things I can do to narrow the real problem?
Thanks in advance,
Daniel