<div dir="ltr">Hi,<div><br></div><div>Sure, I&#39;ve created one using the request scope now (to rule out any issues with JSF&#39;s view scope).</div><div><br></div><div><div>package test;</div><div><br></div><div>import javax.ejb.Stateful;</div><div>import javax.enterprise.context.RequestScoped;</div><div>import javax.enterprise.inject.Produces;</div><div><br></div><div>@Stateful</div><div>@RequestScoped</div><div>public class Bean1 {</div><div><span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">        </span>@Produces</div><div><span class="" style="white-space:pre">        </span>public String produceString() {</div><div><span class="" style="white-space:pre">                </span>return &quot;a string&quot;;</div><div><span class="" style="white-space:pre">        </span>}</div><div><br></div><div><span class="" style="white-space:pre">        </span>public void foo() {</div><div><span class="" style="white-space:pre">                </span></div><div><span class="" style="white-space:pre">        </span>}</div><div><span class="" style="white-space:pre">        </span></div><div>}</div></div><div><br></div><div><br></div><div><br></div><div><div>package test;</div><div><br></div><div>import javax.ejb.Stateful;</div><div>import javax.enterprise.context.RequestScoped;</div><div>import javax.inject.Inject;</div><div><br></div><div>@Stateful</div><div>@RequestScoped</div><div>public class Bean2 {</div><div><br></div><div><span class="" style="white-space:pre">        </span>@Inject</div><div><span class="" style="white-space:pre">        </span>private String string;</div><div><span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">        </span>public void foo() {</div><div><span class="" style="white-space:pre">                </span></div><div><span class="" style="white-space:pre">        </span>}</div><div><span class="" style="white-space:pre">        </span></div><div>}</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><div><br></div><div>package test;</div><div><br></div><div>import javax.ejb.Stateful;</div><div>import javax.enterprise.context.RequestScoped;</div><div>import javax.inject.Inject;</div><div><br></div><div>@Stateful</div><div>@RequestScoped</div><div>public class Bean3 {</div><div><span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">        </span>@Inject</div><div><span class="" style="white-space:pre">        </span>private Bean1 bean1;</div><div><span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">        </span>@Inject </div><div><span class="" style="white-space:pre">        </span>private Bean2 bean2;</div><div><span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">        </span>public void test() {</div><div><span class="" style="white-space:pre">                </span>bean1.foo();</div><div><span class="" style="white-space:pre">                </span>bean2.foo();</div><div><span class="" style="white-space:pre">        </span>}</div><div><br></div><div>}</div></div><div><br></div><div><br></div><div><br></div><div><div>package test;</div><div><br></div><div>import java.io.IOException;</div><div><br></div><div>import javax.inject.Inject;</div><div>import javax.servlet.ServletException;</div><div>import javax.servlet.annotation.WebServlet;</div><div>import javax.servlet.http.HttpServlet;</div><div>import javax.servlet.http.HttpServletRequest;</div><div>import javax.servlet.http.HttpServletResponse;</div><div><br></div><div>@WebServlet(urlPatterns = &quot;/test&quot;)</div><div>public class TestServlet extends HttpServlet {</div><div><br></div><div><span class="" style="white-space:pre">        </span>private static final long serialVersionUID = 1L;</div><div><br></div><div><span class="" style="white-space:pre">        </span>@Inject</div><div><span class="" style="white-space:pre">        </span>private Bean3 bean3;</div><div><br></div><div><span class="" style="white-space:pre">        </span>@Override</div><div><span class="" style="white-space:pre">        </span>public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {</div><div><br></div><div><span class="" style="white-space:pre">                </span>response.getWriter().write(&quot;testing&quot;);</div><div><br></div><div><span class="" style="white-space:pre">                </span>bean3.test();</div><div><br></div><div><span class="" style="white-space:pre">        </span>}</div><div><br></div><div>}</div></div><div><br></div><div>Relevant part of the stack trace:</div><div><br></div><div><div>Caused by: javax.ejb.ConcurrentAccessTimeoutException: WFLYEJB0228: EJB 3.1 FR 4.3.14.1 concurrent access timeout on Bean1 - could not obtain lock within 5000 MILLISECONDS</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ejb3.component.stateful.StatefulSessionSynchronizationInterceptor.processInvocation(StatefulSessionSynchronizationInterceptor.java:86)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:64)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ejb3.component.stateful.StatefulComponentInstanceInterceptor.processInvocation(StatefulComponentInstanceInterceptor.java:65)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:327)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:66)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)</div><div><span class="" style="white-space:pre">        </span>at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:636)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:195)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)</div><div><span class="" style="white-space:pre">        </span>at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)</div><div><span class="" style="white-space:pre">        </span>at test.Bean1$$$view1.produceString(Unknown Source)</div></div><div><br></div><div><br></div><div>If needed I can later today put this in a Maven project as well, but the above should be enough to get you started I hope.</div><div><br></div><div>Kind regards,</div><div>Arjan Tijms</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 16, 2016 at 1:26 PM, Tomas Remes <span dir="ltr">&lt;<a href="mailto:tremes@redhat.com" target="_blank">tremes@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Arjan,<br>
<br>
Can you please share some reproducer app? It would be helpful.<br>
<br>
Thanks<br>
Tom<br>
<div><div class="h5"><br>
----- Original Message -----<br>
From: &quot;arjan tijms&quot; &lt;<a href="mailto:arjan.tijms@gmail.com">arjan.tijms@gmail.com</a>&gt;<br>
To: &quot;WildFly Dev&quot; &lt;<a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a>&gt;<br>
Sent: Tuesday, August 16, 2016 1:12:22 PM<br>
Subject: [wildfly-dev] ConcurrentAccessTimeoutExcepti<wbr>on using producer in       stateful bean<br>
<br>
Hi,<br>
<br>
I came across a situation where a ConcurrentAccessTimeoutExcepti<wbr>on is thrown on WildFly 10.0.0 and 10.1cr1 when an @Stateful @ViewScoped bean contains a CDI producer.<br>
<br>
In short, there are 3 beans all @Stateful @ViewScoped. Beans 1 and 2 are injected in bean 3.<br>
<br>
Bean 1 contains a CDI producer.<br>
Bean 2 is injected with a type from said producer.<br>
<br>
The following causes a ConcurrentAccessTimeoutExcepti<wbr>on to be thrown:<br>
<br>
bean3.somemethod:<br>
tx start<br>
access stateful bean 1<br>
access stateful bean 2<br>
(from statefull bean 2): access injected type that causes producer from bean 1 to be called<br>
tx end<br>
<br>
If the call to stateful bean 1 is omitted, the producer is called normally when bean 2 accesses the injected type.<br>
<br>
If bean 2 is injected directly with bean 1, then bean 1 can be accessed without any ConcurrentAccessTimeoutExcepti<wbr>on being thrown.<br>
<br>
The code runs fine on WildFly 8.2.<br>
<br>
I&#39;ll do some further digging, but wonder if this problem rings any bells. Could it be that CDI obtains a reference to the stateful bean in such a way that the implicit EJB interceptor doesn&#39;t see it&#39;s still within the same TX? But since there&#39;s no call to bean 1 in progress at that point, should this even matter?<br>
<br>
Kind regards,<br>
Arjan Tijms<br>
<br>
</div></div>______________________________<wbr>_________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>