"Transaction present on server in Never call" during remove() on stateless session bean in JBoss EAP 6

Solution Verified - Updated -

Issue

  • The following code creates, uses and removes a stateless session bean:
myStatelessSessionBean = myStatelessSessionBeanHome.create(); 
try { 
    myStatelessSessionBean.doSomething(); 
} finally { 
    myStatelessSessionBean.remove(); 
}

Sometimes, the exception below is raised:

javax.ejb.EJBException java.lang.IllegalStateException: JBAS011048: Failed to construct component instance [nested: javax.ejb.EJBException: java.lang.IllegalStateException
: JBAS014163: Transaction present on server in Never call (EJB3 13.6.2.6)]
        ...
        at java.lang.Thread.run(Thread.java:724)
Caused by: javax.ejb.EJBException: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:165)
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:250)
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:315)
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:214)
        ...
Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
        at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)
        at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85)
        at org.jboss.as.ejb3.component.stateless.StatelessSessionComponent$1.create(StatelessSessionComponent.java:67)
        at org.jboss.as.ejb3.component.stateless.StatelessSessionComponent$1.create(StatelessSessionComponent.java:64)
        at org.jboss.as.ejb3.pool.AbstractPool.create(AbstractPool.java:60)
        at org.jboss.as.ejb3.pool.strictmax.StrictMaxPool.get(StrictMaxPool.java:123)
        at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:47)
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:248)
        ...
Caused by: javax.ejb.EJBException: JBAS014163: Transaction present on server in Never call (EJB3 13.6.2.6)
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.never(CMTTxInterceptor.java:283)
        ...

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 6

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