File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes session handling problem - hibernate-JPA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "session handling problem - hibernate-JPA" Watch "session handling problem - hibernate-JPA" New topic
Author

session handling problem - hibernate-JPA

Sameer Vas
Greenhorn

Joined: Apr 19, 2010
Posts: 1
Hi,
I have a problem in connection management. I'm using Hibernate-JPA. I'm creating an entity manager using the entitymanagerfactory. When try to do a load testing, I'm getting the following problem: (Any help will be really appreciated.)

<Error> <HTTP> <mishit> <wip_prf_mt_04> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1270770247781> <BEA-101020> <[weblogic.servlet.internal.WebAppServletContext@a222cba - appName: 'ServicesEar', name: 'ServicesWeb', context-path: '/ServicesWeb', spec-version: '2.5'] Servlet failed with Exception org.jboss.resteasy.spi.UnhandledException: com.capitalone.ecom.framework.exception.DAOException: getRegionForZipCode at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:263) at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:169) at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:146) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:456) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:418) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:111) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:217) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:159) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.portal.tools.servlet.http.HttpContextFilter.doFilter(HttpContextFilter.java:60) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:336) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3502) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(Unknown Source) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2186) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2092) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) com.capitalone.ecom.framework.exception.DAOException: getRegionForZipCode at com.capitalone.ecom.framework.service.handler.DaoServiceHandler.processAction(DaoServiceHandler.java:83) at com.capitalone.www.capabilities.service.region.RegionServiceImpl.getRegionForZipCode(RegionServiceImpl.java:36) at com.capitalone.www.capabilities.delegate.RegionDelegate.getRegionForZipCode(RegionDelegate.java:58) at com.capitalone.ecom.services.restful.services.RegionResource.getRegionForZip(RegionResource.java:81) at com.capitalone.ecom.services.restful.services.RegionResource.getRegionXML(RegionResource.java:68) at sun.reflect.GeneratedMethodAccessor1020.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:124) at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:247) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:212) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:202) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:441) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:418) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:111) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:217) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:159) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.portal.tools.servlet.http.HttpContextFilter.doFilter(HttpContextFilter.java:60) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:336) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3502) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(Unknown Source) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2186) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2092) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) javax.persistence.PersistenceException: org.hibernate.SessionException: Session is closed! at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614) at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76) at com.capitalone.ecom.framework.persist.dao.impl.GenericJpaDao.findByNamedQuery(GenericJpaDao.java:184) at com.capitalone.www.capabilities.bean.region.GetRegionForZipCode.execute(GetRegionForZipCode.java:61) at com.capitalone.ecom.framework.service.handler.DaoServiceHandler.processAction(DaoServiceHandler.java:77) at com.capitalone.www.capabilities.service.region.RegionServiceImpl.getRegionForZipCode(RegionServiceImpl.java:36) at com.capitalone.www.capabilities.delegate.RegionDelegate.getRegionForZipCode(RegionDelegate.java:58) at com.capitalone.ecom.services.restful.services.RegionResource.getRegionForZip(RegionResource.java:81) at com.capitalone.ecom.services.restful.services.RegionResource.getRegionXML(RegionResource.java:68) at sun.reflect.GeneratedMethodAccessor1020.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:124) at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:247) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:212) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:202) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:441) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:418) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:111) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:217) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:159) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.portal.tools.servlet.http.HttpContextFilter.doFilter(HttpContextFilter.java:60) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:336) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3502) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(Unknown Source) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2186) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2092) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) org.hibernate.SessionException: Session is closed! at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:72) at org.hibernate.impl.SessionImpl.getBatcher(SessionImpl.java:287) at org.hibernate.loader.Loader.getResultSet(Loader.java:1822) at org.hibernate.loader.Loader.doQuery(Loader.java:697) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.doList(Loader.java:2228) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125) at org.hibernate.loader.Loader.list(Loader.java:2120) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67) at com.capitalone.ecom.framework.persist.dao.impl.GenericJpaDao.findByNamedQuery(GenericJpaDao.java:184) at com.capitalone.www.capabilities.bean.region.GetRegionForZipCode.execute(GetRegionForZipCode.java:61) at com.capitalone.ecom.framework.service.handler.DaoServiceHandler.processAction(DaoServiceHandler.java:77) at com.capitalone.www.capabilities.service.region.RegionServiceImpl.getRegionForZipCode(RegionServiceImpl.java:36) at com.capitalone.www.capabilities.delegate.RegionDelegate.getRegionForZipCode(RegionDelegate.java:58) at com.capitalone.ecom.services.restful.services.RegionResource.getRegionForZip(RegionResource.java:81) at com.capitalone.ecom.services.restful.services.RegionResource.getRegionXML(RegionResource.java:68) at sun.reflect.GeneratedMethodAccessor1020.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:124) at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:247) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:212) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:202) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:441) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:418) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:111) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:217) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:159) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.portal.tools.servlet.http.HttpContextFilter.doFilter(HttpContextFilter.java:60) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:336) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3502) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(Unknown Source) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2186) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2092) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) >
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: session handling problem - hibernate-JPA