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