users@glassfish.java.net

Re: org.hibernate.SessionException:Session is closed!

From: Sahoo <sahoo_at_sun.com>
Date: Tue, 25 Nov 2008 20:31:14 +0530

Can you please tell us how you are using Hibernate from your MDB? How do
you obtain the EntityManager and use it?

Thanks,
Sahoo

glassfish_at_javadesktop.org wrote:
> Hi Guys,
>
> I am getting weired Exception while i am trying do with two phase commit in glassfish. I am using glassfish v2 ,ejb3, and JMS, JTA.
>
> Please suggest me.
>
>
> javax.persistence.PersistenceException: org.hibernate.SessionException: Session is closed!
> at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630)
> at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:510)
> at com.sun.jts.jta.SynchronizationImpl.before_completion(SynchronizationImpl.java:99)
> at com.sun.jts.CosTransactions.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:158)
> at com.sun.jts.CosTransactions.TopCoordinator.beforeCompletion(TopCoordinator.java:2548)
> at com.sun.jts.CosTransactions.CoordinatorTerm.commit(CoordinatorTerm.java:278)
> at com.sun.jts.CosTransactions.TerminatorImpl.commit(TerminatorImpl.java:249)
> at com.sun.jts.CosTransactions.CurrentImpl.commit(CurrentImpl.java:623)
> at com.sun.jts.jta.TransactionManagerImpl.commit(TransactionManagerImpl.java:309)
> at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.commit(J2EETransactionManagerImpl.java:1030)
> at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:397)
> at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3792)
> at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3585)
> at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1354)
> at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1316)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:205)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:127)
> at $Proxy142.processingFailed(Unknown Source)
> at com.sonybmg.aoma.transactionmanager.impl.MetadataImporterImpl.executeAttempt(MetadataImporterImpl.java:197)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067)
> at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176)
> at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2895)
> at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3986)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:197)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:127)
> at $Proxy138.executeAttempt(Unknown Source)
> at com.sonybmg.aoma.session.ProcessXMLSessionBean.processXML(ProcessXMLSessionBean.java:56)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067)
> at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176)
> at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2895)
> at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3986)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:197)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:127)
> at $Proxy139.processXML(Unknown Source)
> at com.sonybmg.aoma.transactionmanager.q.ImportXMLMDB.onMessage(ImportXMLMDB.java:58)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067)
> at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176)
> at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2895)
> at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3986)
> at com.sun.ejb.containers.MessageBeanContainer.deliverMessage(MessageBeanContainer.java:1111)
> at com.sun.ejb.containers.MessageBeanListenerImpl.deliverMessage(MessageBeanListenerImpl.java:74)
> at com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:179)
> at $Proxy145.onMessage(Unknown Source)
> at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:258)
> at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:76)
> at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
> Caused by: org.hibernate.SessionException: Session is closed!
> at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:49)
> at org.hibernate.impl.SessionImpl.getTransaction(SessionImpl.java:1314)
> at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:489)
> ... 56 more
> [Message sent by forum member 'chalava' (chalava)]
>
> http://forums.java.net/jive/thread.jspa?messageID=318650
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>