javax.naming.NameNotFoundException: Name comp/websphere not found in context "java:".]

Hibernate JIRA | Chris Rose | 10 years ago
  1. 0

    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.websphere.javadoc.doc/public_html/api/com/ibm/websphere/jtaextensions/SynchronizationCallback.html#main 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)

    Hibernate JIRA | 10 years ago | Chris Rose
    javax.naming.NameNotFoundException: Name comp/websphere not found in context "java:".]
  2. 0

    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.websphere.javadoc.doc/public_html/api/com/ibm/websphere/jtaextensions/SynchronizationCallback.html#main 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)

    Hibernate JIRA | 10 years ago | Chris Rose
    javax.naming.NameNotFoundException: Name comp/websphere not found in context "java:".]
  3. 0

    EJB lookup

    Oracle Community | 8 years ago | 843830
    javax.naming.NameNotFoundException: Name comp/env/ejb not found in context "java:".
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    When configuraing jBPM / Hibernate with a datasource in an Enterprise application, using a local JNDI reference (java:comp/env/...) the web application works properly, accessing the database without any problem. But if you declare the JobExecutorServlet in the web application's web.xml, each time the this servlet JobExecutorThread fires, it generates exceptions: [22/08/07 18:33:03:175 CEST] 0000005e SystemOut O 18:33:03 DEBUG org.jbpm.job.executor.JobExecutorThread : acquiring jobs for execution... [22/08/07 18:33:03:315 CEST] 0000005f javaURLContex E NMSV0310E: Une opération JNDI sur un nom "java:" ne peut pas aboutir car le contexte d'exécution du serveur ne peut pas associer l'unité d'exécution de l'opération à un composant d'application J2EE. Cette condition peut se produire lorsque le client JNDI utilisant le nom "java:" n'est pas exécuté sur l'unité d'exécution d'une demande d'application du serveur. Assurez-vous qu'une application J2EE n'exécute pas d'opérations JNDI sur des noms "java:" dans des blocs de code statiques ou dans des unités d'exécution créées par cette application J2EE. Un code de ce type ne s'exécute pas nécessairement sur l'unité d'exécution d'une demande d'application du serveur et n'est donc pas pris en charge par les opérations JNDI sur les noms "java:". Trace de pile d'exceptions : javax.naming.ConfigurationException [Root exception is javax.naming.NameNotFoundException: Name comp/env/jdbc 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 org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56) at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292) at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91) at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:94) at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98) at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersistenceService.java:354) at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563) at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:109) at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56) Caused by: javax.naming.NameNotFoundException: Name comp/env/jdbc 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) ... 17 more [22/08/07 18:33:03:347 CEST] 0000005e SystemOut O 18:33:03 FATAL org.hibernate.connection.DatasourceConnectionProvider : Could not find datasource: java:comp/env/jdbc/dsJBPM javax.naming.ConfigurationException: A JNDI operation on a "java:" name cannot be completed because the serverruntime 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. [Root exception is javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".] at com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:416) 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 org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56) at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292) at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91) at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:94) at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98) at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersistenceService.java:354) at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563) at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:109) at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56) Caused by: javax.naming.NameNotFoundException: Name comp/env/jdbc 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) ... 17 more [22/08/07 18:33:03:347 CEST] 0000005e SystemOut O 18:33:03 ERROR org.jbpm.job.executor.JobExecutorThread : exception in job executor thread. waiting 10000 milliseconds org.hibernate.HibernateException: Could not find datasource at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56) at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292) at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91) at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:94) at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98) at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersistenceService.java:354) at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563) at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:109) at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56) Caused by: javax.naming.ConfigurationException: A JNDI operation on a "java:" name cannot be completed because the serverruntime 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. [Root exception is javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".] at com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:416) 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 org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52) ... 13 more Caused by: javax.naming.NameNotFoundException: Name comp/env/jdbc 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) ... 17 more The exception is raised even if there is no timer in the process definition. If I replace the local JNDI reference (java:comp/env/jdbc/datasource) with the global JNDI name (jdbc/dsOracle) the JobExecutorThread works fine (even if Websphere logs warning due to direct use of the global JNDI reference). The JobExecutorThread also works if I replace the datasource with the database access parameters (driver, url, ...). (sample ear is available to reproduce the bug if necessary)

    JBoss Issue Tracker | 9 years ago | Jacques Desmazières
    javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".]
  6. 0

    Seam Injecting EJB3 in Websphere. | JBoss Developer

    jboss.org | 6 months ago
    org.jboss.seam.InstantiationException: Could not instantiate Seam component: sessionBeanA

    4 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.naming.NameNotFoundException

      Name comp/websphere not found in context "java:".

      at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal()
    2. WebSphere
      javaURLContextRoot.lookup
      1. com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1767)
      2. com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1083)
      3. com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:991)
      4. com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263)
      5. com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:384)
      6. com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:204)
      7. com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:144)
      7 frames
    3. Java RT
      InitialContext.lookup
      1. javax.naming.InitialContext.lookup(InitialContext.java:363)
      1 frame
    4. com.aciworldwide.ecourier
      WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter.getStatus
      1. com.aciworldwide.ecourier.utility.hibernate.extensions.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter.getExtendedJTATransaction(WebSphereExtendedJTATransactionLookup.java:126)
      2. com.aciworldwide.ecourier.utility.hibernate.extensions.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter.getLocalId(WebSphereExtendedJTATransactionLookup.java:191)
      3. com.aciworldwide.ecourier.utility.hibernate.extensions.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter.getStatus(WebSphereExtendedJTATransactionLookup.java:216)
      3 frames
    5. Hibernate
      JTAHelper.isTransactionInProgress
      1. org.hibernate.util.JTAHelper.isTransactionInProgress(JTAHelper.java:44)
      1 frame
    6. Hibernate
      JDBCContext.isTransactionInProgress
      1. org.hibernate.transaction.CMTTransactionFactory.isTransactionInProgress(CMTTransactionFactory.java:47)
      2. org.hibernate.jdbc.JDBCContext.isTransactionInProgress(JDBCContext.java:187)
      2 frames
    7. Hibernate
      SessionImpl.saveOrUpdate
      1. org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:240)
      2. org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
      3. org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:121)
      4. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
      5. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
      6. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
      7. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
      8. org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
      9. org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
      9 frames
    8. Hibernate
      Cascade.cascade
      1. org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:218)
      2. org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
      3. org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
      4. org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
      5. org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
      6. org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
      7. org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
      8. org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
      9. org.hibernate.engine.Cascade.cascade(Cascade.java:130)
      9 frames
    9. Hibernate
      SessionImpl.managedFlush
      1. org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
      2. org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
      3. org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
      4. org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
      5. org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
      6. org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
      6 frames
    10. Hibernate
      CacheSynchronization.beforeCompletion
      1. org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
      1 frame
    11. com.aciworldwide.ecourier
      WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter$1.invoke
      1. com.aciworldwide.ecourier.utility.hibernate.extensions.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter$1.invoke(WebSphereExtendedJTATransactionLookup.java:151)
      1 frame
    12. Unknown
      $Proxy4.beforeCompletion
      1. $Proxy4.beforeCompletion(Unknown Source)
      1 frame
    13. com.ibm.ws
      TranManagerSet.commit
      1. com.ibm.ws.jtaextensions.SynchronizationCallbackWrapper.beforeCompletion(SynchronizationCallbackWrapper.java:65)
      2. com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:240)
      3. com.ibm.ws.Transaction.JTA.TransactionImpl.prePrepare(TransactionImpl.java:2373)
      4. com.ibm.ws.Transaction.JTA.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:1606)
      5. com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java:1577)
      6. com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1512)
      7. com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:237)
      8. com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:162)
      8 frames
    14. com.ibm.ejs
      EJSContainer.postInvoke
      1. com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:756)
      2. com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:181)
      3. com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:581)
      4. com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3893)
      5. com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3715)
      5 frames
    15. com.aciworldwide.ecourier
      _EJSRemoteStatelessDocumentManager_dff32e35_Tie._invoke
      1. com.aciworldwide.ecourier.management.ejb.remote.EJSRemoteStatelessDocumentManager_dff32e35.addTrackingEvent(Unknown Source)
      2. com.aciworldwide.ecourier.management.ejb.remote._EJSRemoteStatelessDocumentManager_dff32e35_Tie.addTrackingEvent(_EJSRemoteStatelessDocumentManager_dff32e35_Tie.java:228)
      3. com.aciworldwide.ecourier.management.ejb.remote._EJSRemoteStatelessDocumentManager_dff32e35_Tie._invoke(_EJSRemoteStatelessDocumentManager_dff32e35_Tie.java:119)
      3 frames
    16. com.ibm.CORBA
      ServerDelegate.dispatch
      1. com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:613)
      2. com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:466)
      2 frames
    17. com.ibm.rmi
      ORB.process
      1. com.ibm.rmi.iiop.ORB.process(ORB.java:503)
      1 frame
    18. com.ibm.CORBA
      ORB.process
      1. com.ibm.CORBA.iiop.ORB.process(ORB.java:1552)
      1 frame
    19. com.ibm.rmi
      WorkUnitImpl.doWork
      1. com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2673)
      2. com.ibm.rmi.iiop.Connection.doWork(Connection.java:2551)
      3. com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
      3 frames
    20. com.ibm.ejs
      PooledThread.run
      1. com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
      1 frame
    21. com.ibm.ws
      ThreadPool$Worker.run
      1. com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
      1 frame