IBM Support

PK77243; 6.1.0.21: Java.lang.illegalstateexception: no active transaction

Download


Abstract

This exception is seen when events are sent through multiple connections, with Common Event Infrastructure service configured to always send the events in a new transaction.

Download Description

PK77243 resolves the following problem:

ERROR DESCRIPTION:
When running in a cluster environment, we see the following exceptions:

[11/20/08 16:56:59:703 CET] 00000061 ExceptionUtil E CNTR0019E

: EJB threw an unexpected (non-declared) exception during invocation of
method "getInputMessage". Exception data: java.lang.IllegalState

Exception: No active transaction
at com.ibm.ejs.csi.TransactionControlImpl.setRollbackOnly(Transaction
ControlImpl.java:774)
at com.ibm.ejs.csi.UOWControlImpl.setRollbackOnly(UOWControl
Impl.java:554)
at com.ibm.ejs.container.EJSContainer.getCurrentTx(EJSContaine
r.java:2041)
at com.ibm.ejs.container.EJSContainer.preInvokeActivate(EJSCon
tainer.java:3480)
at com.ibm.ejs.container.EJSContainer.preInvoke(EJSContainer.j
ava:2933)
at com.ibm.task.api.EJSRemoteStatelessGenericHumanTaskManagerE
JB_efcf8cd2.getInputMessage(Unknown Source)
at com.ibm.task.api._HumanTaskManager_Stub.getInputMessage(_Hu
manTaskManager_Stub.java:11181)
at com.ibm.task.clientmodel.bean.TaskInstanceBean.getInputMess
ageWrapper(TaskInstanceBean.java:1797)
at com.bpc.samples.handler.CustomTaskMessageHandler.itemChange
d(CustomTaskMessageHandler.java:67)
at com.ibm.bpe.jsf.handler.BPCListHandlerSelectionHelper.notif
yItemListener(BPCListHandlerSelectionHelper.java:342)
at com.ibm.bpe.jsf.handler.BPCListHandlerSelectionHelper.choos
eItem(BPCListHandlerSelectionHelper.java:168)
at com.sun.reflect.GeneratedMethodAccessor200.invoke(Unknown S
ource)
at com.sun.reflect.DelegatingMethodAccessorImpl.invoke(Delegat
ingMethodAccessorImpl.java:43)
at com.java.lang.reflect.Method.invoke(Method.java:618)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl
.java:127)
at com.javax.faces.component.UICommand.broadcast(UICommand.jav
a:305)
at com.javax.faces.component.UIData.broadcast(UIData.java:657)
at com.javax.faces.component.UIViewRoot.broadcastEvents(UIView
Root.java:302)
at com.javax.faces.component.UIViewRoot.processApplication(UIV
iewRoot.java:419)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(Invo
keApplicationPhase.java:77)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl
.java:91)
at com.javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Serv
letWrapper.java:1096)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleReques
t(ServletWrapper.java:570)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequ
est(ServletWrapper.java:478)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleR
equest(CacheServletWrapper.java:90)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebConta
iner.java:748)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebCon
tainer.java:1466)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChann
elLink.java:119)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handle
Discrimination(HttpInboundLink.java:458)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handle
NewInformation(HttpInboundLink.java:387)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.co
mplete(HttpICLReadCallback.java:102)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futur
eCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(Abstrac
tAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(A
syncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136
)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:
195)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(Resul
tHandler.java:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873
)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)


The exception occurs when we invoke methods on HumanTaskManager
enterprise bean or on BusinessFlowManager enterprise bean. Both beans
are stateless session beans with Container managed transactions and a
transaction attribute of Required.

The caller is a JavaServer Faces (jsf) application that does not control
transactions at all. We expect the EJB Container to create new transactions
with each enterprise bean method (since the client does not deal with
transactions). This seems not to happen. Interestingly, we see the problem
only in cluster scenarios, not on stand-alone servers.

LOCAL FIX:

PROBLEM SUMMARY:

USERS AFFECTED:
IBM WebSphere Application Server V6.1 and V7.0 Common Event
Infrastructure (CEI) users that set up CEI to always send events in a new
transaction.

PROBLEM DESCRIPTION:
This exception is seen when events are sent via multiple connections, with
Common Event Infrastructure
service configured to always send the events in a new transaction. At some
point one of the threads treating the connections will want to publish the events
it is dealing with. This means it has to suspend the current global transaction.
When another thread will want to do publish, wants to do the same, but the
global transaction is already suspended. This is when the exception is thrown.

RECOMMENDATION:
None

Exception that can be seen is:
Exception = java.lang.IllegalStateException
Source =
com.ibm.ws.Transaction.JTA.TransactionImpl.registerSynchronization probeid
= 2297
Stack Dump = java.lang.IllegalStateException: Transaction is inactive or prepared
at
com.ibm.ws.Transaction.JTA.TransactionImpl.registerSynchronization(Transaction
Impl.java:3555)
at
com.ibm.ws.Transaction.JTA.TransactionImpl.registerSynchronization(Transaction
Impl.java:3525)
at
com.ibm.ws.Transaction.JTA.TranManagerSet.registerSynchronization(TranManager
Set.java:507)
at
com.ibm.ejs.j2c.XATransactionWrapper.addSync(XATransactionWrapper.java:289)
at
com.ibm.ejs.j2c.ConnectionManager.initializeForUOW(ConnectionManager.java:1290)
at
com.ibm.ejs.j2c.ConnectionManager.involveMCInTran(ConnectionManager.java:1038)
at
com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:602)
at
com.ibm.ws.sib.api.jmsra.impl.JmsJcaConnectionFactoryImpl.create Connection(JmsJcaConnectionFactoryImpl.java:256)
at
com.ibm.ws.sib.api.jms.impl.JmsManagedConnectionFactoryImpl.createConnection
(JmsManagedConnectionFactoryImpl.java:208)
at
com.ibm.ws.sib.api.jms.impl.JmsManagedQueueConnectionFactoryImpl
.createQueueConnection(JmsManagedQueueConnectionFactoryImpl.java:146)
at
com.ibm.ws.sib.api.jms.impl.JmsManagedQueueConnectionFactoryImpl
.createQueueConnection(JmsManagedQueueConnectionFactoryImpl.java:110)
at
com.ibm.events.emitter.impl.J2eeJmsQueueSender.sendEvents(J2eeJmsQueueSender.
java:268)
at
com.ibm.events.emitter.impl.EmitterImpl.sendEventX(EmitterImpl.java:1716)
at
com.ibm.events.emitter.impl.EmitterImpl.sendEvent(EmitterImpl.java:777)
at com.ibm.websphere.cem.ECSEmitter$1.run(ECSEmitter.java:268)

The transactions are failing because they are being resumed on multiple threads and
then these contend with completion activities and fail with IllegalStateExceptions.

PROBLEM CONCLUSION:
Making the transaction handler a thread-local field will ensure that every thread has its own
transaction handler and will not be able to suspend/resume other threads' transaction.

The fix for this APAR is currently targeted for inclusion in fix packs 6.1.0.23 and 7.0.0.3.

Please refer to the Recommended Updates page for delivery information:
http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980

Prerequisites

Please download the UpdateInstaller below to install this fix.

[{"PRLabel":"UpdateInstaller","PRLang":"US English","PRSize":"7250000","PRPlat":{"label":"AIX","code":"PF002"},"PRURL":"http://www.ibm.com/support/docview.wss?rs=180&uid=swg21205991"}]

Installation Instructions

Please review the readme.txt for detailed installation instructions.

[{"INLabel":"Readme","INLang":"US English","INSize":"18353","INURL":"ftp://public.dhe.ibm.com/software/websphere/appserv/support/fixes/PK77243/readme.txt"}]
On
[{"DNLabel":"6.1.0.17-WS-WAS-IFPK77243","DNDate":"12/11/2008","DNLang":"US English","DNSize":"8731","DNPlat":{"label":"AIX","code":"PF002"},"DNURL":"http://www.ibm.com/support/fixcentral/quickorder?fixids=6.1.0.17-WS-WAS-IFPK77243&product=ibm%2FWebSphere%2FWebSphere%20Application%20Server&source=dbluesearch","DNURL_FTP":"ftp://public.dhe.ibm.com/software/websphere/appserv/support/fixes/PK77243/6.1.0.17-WS-WAS-IFPK77243.pak","DDURL":"http://public.dhe.ibm.com:7618;sw_websphere;appserv/support/fixes/PK77243/6.1.0.17-WS-WAS-IFPK77243.pak"}]

Technical Support

Contact IBM Support using SR (http://www-306.ibm.com/software/support/probsub.html), visit the WebSphere Application Server Support Web site (http://www.ibm.com/software/webservers/appserv/was/support/), or contact 1-800-IBM-SERV(U.S. only).

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Java Transaction Service (JTS)","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"6.1.0.21","Edition":"Network Deployment;Single Server","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg24021626