<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"><<a href="mailto:tremes@redhat.com" target="_blank">tremes@redhat.com</a>></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'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: "arjan tijms" <<a href="mailto:arjan.tijms@gmail.com">arjan.tijms@gmail.com</a>><br>
</span><div class="HOEnZb"><div class="h5">To: "Tomas Remes" <<a href="mailto:tremes@redhat.com">tremes@redhat.com</a>><br>
Cc: "WildFly Dev" <<a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a>><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've created one using the request scope now (to rule out any issues<br>
with JSF'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 "a string";<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 = "/test")<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("<wbr>testing");<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 <<a href="mailto:tremes@redhat.com">tremes@redhat.com</a>> wrote:<br>
<br>
><br>
> Hi Arjan,<br>
><br>
> Can you please share some reproducer app? It would be helpful.<br>
><br>
> Thanks<br>
> Tom<br>
><br>
> ----- Original Message -----<br>
> From: "arjan tijms" <<a href="mailto:arjan.tijms@gmail.com">arjan.tijms@gmail.com</a>><br>
> To: "WildFly Dev" <<a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a>><br>
> Sent: Tuesday, August 16, 2016 1:12:22 PM<br>
> Subject: [wildfly-dev] ConcurrentAccessTimeoutExcepti<wbr>on using producer<br>
> in stateful bean<br>
><br>
> Hi,<br>
><br>
> I came across a situation where a ConcurrentAccessTimeoutExcepti<wbr>on is<br>
> thrown on WildFly 10.0.0 and 10.1cr1 when an @Stateful @ViewScoped bean<br>
> contains a CDI producer.<br>
><br>
> In short, there are 3 beans all @Stateful @ViewScoped. Beans 1 and 2 are<br>
> 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<br>
> bean 1 to be called<br>
> tx end<br>
><br>
> If the call to stateful bean 1 is omitted, the producer is called normally<br>
> when bean 2 accesses the injected type.<br>
><br>
> If bean 2 is injected directly with bean 1, then bean 1 can be accessed<br>
> without any ConcurrentAccessTimeoutExcepti<wbr>on being thrown.<br>
><br>
> The code runs fine on WildFly 8.2.<br>
><br>
> I'll do some further digging, but wonder if this problem rings any bells.<br>
> Could it be that CDI obtains a reference to the stateful bean in such a way<br>
> that the implicit EJB interceptor doesn't see it's still within the same<br>
> TX? But since there's no call to bean 1 in progress at that point, should<br>
> this even matter?<br>
><br>
> Kind regards,<br>
> Arjan Tijms<br>
><br>
> ______________________________<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>
><br>
<br>
<br>
</div></div></blockquote></div><br></div>