Illegal JNDI lookup of java:comp/websphere/ExtendedJTATransaction in beforeCompletion
method in WebSphere 6.1.0.5
-----------------------------------------------------------------------------------------------------------------
Key: HHH-2632
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2632
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.4.sp1, 3.2.3
Environment: WebSphere application server 6.1.0.5
Hibernate 3.2.4sp1 and 3.2.3
Oracle 9i
Reporter: Chris Rose
Attachments: hibernate_issue.was61.log,
WebSphereExtendedJTATransactionLookup.java
Hibernate's WebSphere JTA lookup class is performing an illegal JNDI lookup during the
beforeCompletion method call in the SynchronizationCallback handler on WebSphere 6.1
WebSphere's own documentation on this at
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/topic/com.ibm.websp...
indicates that beforeCompletion and afterCompletion should not make JNDI calls in the
java: namespace, which means that the lookup for the ExtendedJTATransaction is not a legal
operation.
In the trace below you'll see a replacement WebSphereExtendedJTATransactionLookup
class (source code attached to this report) that attempted to get around this by lazily
loading the ExtendedJTATransaction reference on demand, but that doesn't solve the
problem. Note that the behaviour of the class is not affected by this change, it just
looks up the reference on demand instead of during construction.
I'm not sure what the correct solution is; there doesn't seem to be a time in the
lifecycle of the transaction manager where the ExtendedJTATransaction could be cached, but
that's the obvious requirement.
Stack trace follows:
[5/23/07 17:09:19:877 GMT-07:00] 00000025 javaURLContex E NMSV0310E: A JNDI operation on
a "java:" name cannot be completed because the server runtime is not able to
associate the operation's thread with any J2EE application component. This condition
can occur when the JNDI client using the "java:" name is not executed on the
thread of a server application request. Make sure that a J2EE application does not execute
JNDI operations on "java:" names within static code blocks or in threads created
by that J2EE application. Such code does not necessarily run on the thread of a server
application request and therefore is not supported by JNDI operations on "java:"
names. Exception stack trace:
javax.naming.ConfigurationException [Root exception is javax.naming.NameNotFoundException:
Name comp/websphere not found in context "java:".]
at
com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:411)
at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:388)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:204)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:144)
at javax.naming.InitialContext.lookup(InitialContext.java:363)
at
com.aciworldwide.ecourier.utility.hibernate.extensions.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter.getExtendedJTATransaction(WebSphereExtendedJTATransactionLookup.java:126)
at
com.aciworldwide.ecourier.utility.hibernate.extensions.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter.getLocalId(WebSphereExtendedJTATransactionLookup.java:191)
at
com.aciworldwide.ecourier.utility.hibernate.extensions.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter.getStatus(WebSphereExtendedJTATransactionLookup.java:216)
at org.hibernate.util.JTAHelper.isTransactionInProgress(JTAHelper.java:44)
at
org.hibernate.transaction.CMTTransactionFactory.isTransactionInProgress(CMTTransactionFactory.java:47)
at org.hibernate.jdbc.JDBCContext.isTransactionInProgress(JDBCContext.java:187)
at
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:240)
at
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:121)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:218)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
at
org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
at
org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
at
org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at
org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
at
com.aciworldwide.ecourier.utility.hibernate.extensions.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter$1.invoke(WebSphereExtendedJTATransactionLookup.java:151)
at $Proxy4.beforeCompletion(Unknown Source)
at
com.ibm.ws.jtaextensions.SynchronizationCallbackWrapper.beforeCompletion(SynchronizationCallbackWrapper.java:65)
at com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:240)
at com.ibm.ws.Transaction.JTA.TransactionImpl.prePrepare(TransactionImpl.java:2373)
at
com.ibm.ws.Transaction.JTA.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:1606)
at com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java:1577)
at com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1512)
at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:237)
at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:162)
at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:756)
at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:181)
at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:581)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3893)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3715)
at
com.aciworldwide.ecourier.management.ejb.remote.EJSRemoteStatelessDocumentManager_dff32e35.addTrackingEvent(Unknown
Source)
at
com.aciworldwide.ecourier.management.ejb.remote._EJSRemoteStatelessDocumentManager_dff32e35_Tie.addTrackingEvent(_EJSRemoteStatelessDocumentManager_dff32e35_Tie.java:228)
at
com.aciworldwide.ecourier.management.ejb.remote._EJSRemoteStatelessDocumentManager_dff32e35_Tie._invoke(_EJSRemoteStatelessDocumentManager_dff32e35_Tie.java:119)
at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:613)
at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:466)
at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
at com.ibm.CORBA.iiop.ORB.process(ORB.java:1552)
at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2673)
at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2551)
at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
Caused by: javax.naming.NameNotFoundException: Name comp/websphere not found in context
"java:".
at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1767)
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1083)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:991)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263)
at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:384)
... 61 more
[5/23/07 17:09:19:884 GMT-07:00] 00000025 RegisteredSyn E WTRN0074E: Exception caught
from before_completion synchronization operation: java.lang.UnsupportedOperationException
at
com.aciworldwide.ecourier.utility.hibernate.extensions.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter.setRollbackOnly(WebSphereExtendedJTATransactionLookup.java:226)
at
org.hibernate.transaction.CacheSynchronization.setRollbackOnly(CacheSynchronization.java:73)
at
org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:63)
at
com.aciworldwide.ecourier.utility.hibernate.extensions.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter$1.invoke(WebSphereExtendedJTATransactionLookup.java:151)
at $Proxy4.beforeCompletion(Unknown Source)
at
com.ibm.ws.jtaextensions.SynchronizationCallbackWrapper.beforeCompletion(SynchronizationCallbackWrapper.java:65)
at com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:240)
at com.ibm.ws.Transaction.JTA.TransactionImpl.prePrepare(TransactionImpl.java:2373)
at
com.ibm.ws.Transaction.JTA.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:1606)
at com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java:1577)
at com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1512)
at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:237)
at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:162)
at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:756)
at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:181)
at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:581)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3893)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3715)
at
com.aciworldwide.ecourier.management.ejb.remote.EJSRemoteStatelessDocumentManager_dff32e35.addTrackingEvent(Unknown
Source)
at
com.aciworldwide.ecourier.management.ejb.remote._EJSRemoteStatelessDocumentManager_dff32e35_Tie.addTrackingEvent(_EJSRemoteStatelessDocumentManager_dff32e35_Tie.java:228)
at
com.aciworldwide.ecourier.management.ejb.remote._EJSRemoteStatelessDocumentManager_dff32e35_Tie._invoke(_EJSRemoteStatelessDocumentManager_dff32e35_Tie.java:119)
at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:613)
at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:466)
at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
at com.ibm.CORBA.iiop.ORB.process(ORB.java:1552)
at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2673)
at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2551)
at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira