Getting javax.ejb.ConcurrentAccessTimeoutException WFLYEJB0241 on Singleton EJB in JBoss EAP 8 / 7 / 6

Solution Verified - Updated -

Issue

  • Our @Singleton EJB is logging this exception in EAP 7:
ERROR [org.jboss.as.ejb3.invocation] (ServerService Thread Pool -- 208) WFLYEJB0034: Jakarta Enterprise Beans Invocation failed on component MySingletonEJBImpl for method public abstract void com.redhat.examples.MySingletonEJB.invoke(java.lang.String): javax.ejb.ConcurrentAccessTimeoutException: WFLYEJB0241: Enterprise Beans 3.1 PFD2 4.8.5.5.1 concurrent access timeout on MySingletonEJBImpl - could not obtain lock within 5000MILLISECONDS
  at org.jboss.as.ejb3.component.singleton.ContainerManagedConcurrencyInterceptor.processInvocation(ContainerManagedConcurrencyInterceptor.java:102) [wildfly-ejb3-7.4.0.GA-redhat-00005.jar:7.4.0.GA-redhat-00005]
  at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
  ... 
  • Getting exception like below.
javax.ejb.ConcurrentAccessTimeoutException: JBAS014373: EJB 3.1 PFD2 4.8.5.5.1 concurrent access timeout on org.jboss.invocation.InterceptorContext$Invocation@7d5446 - could not obtain lock within 5000MILLISECONDS
org.jboss.as.ejb3.concurrency.ContainerManagedConcurrencyInterceptor.processInvocation(ContainerManagedConcurrencyInterceptor.java:100) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
    ...
  • Having the error above even if the class is annotated with @Lock(READ)
@Singleton
@javax.ejb.Lock(javax.ejb.LockType.READ)
public class MySingletonBean {

    public void aReadMethod() {...}
    @javax.ejb.Lock(javax.ejb.LockType.WRITE)
    public void aWriteMethod() {...}
}

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 8.x
    • 7.x
    • 6.x
  • Java Enterprise
    • EJB 3.1 onwards

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content