I received the following error after upgrading from Hibernate 3.1 to Hibernate 3.1.1.
My application uses stateless session beans to retrieve POJO's from hibernate. Each method call involves opening a hibernate session, retrieving some data, closing the session and finally returning the POJO’s to the client.
I receive the error below during the marshall/unmarshall processing of returning a list of POJO’s on WebLogic 8.1.
The POJO's that are returned are retrieved using HQL. All many-to-one and bags are lazy loaded and are not retrieved in this query.
The object model is as follows.
A list of Labels.
Label contains a many-to-one relationship to NriApplication which contains a bag of FunctionKey.
I reverted back to Hibernate 3.1 and the methods began working correctly.
Arthur Fitt
arthur.fitt@netregulus.com
org.hibernate.SessionException: Session is closed!
at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:50)
at org.hibernate.impl.SessionImpl.getPersistenceContext(SessionImpl.java:1794)
at org.hibernate.proxy.BasicLazyInitializer.getReplacement(BasicLazyInitializer.java:100)
at org.hibernate.proxy.BasicLazyInitializer.invoke(BasicLazyInitializer.java:54)
at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:156)
at com.netregulus.common.businessmodel.shared.NriApplication$$EnhancerByCGLIB$$aad3fbcb.writeReplace(<generated>)
at sun.reflect.GeneratedMethodAccessor140.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:896)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1011)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at java.util.ArrayList.writeObject(ArrayList.java:529)
at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at weblogic.rmi.internal.CBVOutputStream.writeObject(CBVOutputStream.java:78)
at weblogic.rmi.internal.ServerRequest.unmarshalReturn(ServerRequest.java:94)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:293)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:247)
at com.netregulus.bt.core.util.ReferenceDataProviderEJB_895xpq_EOImpl_814_WLStub.getLables(Unknown Source)
at com.netregulus.bt.core.util.ReferenceDataProviderEJBProxy.getLables(ReferenceDataProviderEJBProxy.java:168)
at com.netregulus.ui.core.cache.ReferenceDataCache.getLabelWrapper(ReferenceDataCache.java:750)
at com.netregulus.ui.core.cache.ReferenceDataCache.getLabel(ReferenceDataCache.java:776)
at com.netregulus.ui.core.cache.ReferenceDataCache.getLabel(ReferenceDataCache.java:783)
at com.netregulus.ui.core.util.ErrorPage.getLabel(ErrorPage.java:232)
at jsp_servlet.__errorpage._jspService(__errorpage.java:168)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at com.netregulus.ui.core.filtersandlisteners.LoggingMDCFilter.doFilter(LoggingMDCFilter.java:60)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at com.netregulus.ui.core.filtersandlisteners.NriUploadFilter.doFilter(NriUploadFilter.java:91)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:326)
at weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:531)
at weblogic.servlet.internal.WebAppServletContext.handleException(WebAppServletContext.java:4056)
at weblogic.servlet.internal.WebAppServletContext.handleThrowableFromInvocation(WebAppServletContext.java:3834)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3780)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)