-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Issue with org.hibernate.SessionException: Session is closed
PostPosted: Sat Oct 18, 2008 8:47 am 
Beginner
Beginner

Joined: Thu Sep 11, 2008 5:33 am
Posts: 28
Hi All,

I am facing a weird problem during hibernate search. I am getting the below mentioned error.

When i search first time it goes fine but when i try next time without refreshing the page it throws up this error.

Code:
18:01:21,262 FATAL [application] javax.ejb.EJBTransactionRolledbackException: Session is closed!
javax.faces.el.EvaluationException: javax.ejb.EJBTransactionRolledbackException: Session is closed!
   at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
   at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
   at javax.faces.component.UICommand.broadcast(UICommand.java:383)
   at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:317)
   at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:292)
   at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:249)
   at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:462)
   at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
   at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
   at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
   at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
   at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
   at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
   at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
   at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
   at java.lang.Thread.run(Thread.java:595)
Caused by: javax.ejb.EJBTransactionRolledbackException: Session is closed!
   at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
   at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
   at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
   at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
   at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
   at $Proxy151.search(Unknown Source)
   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 org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
   at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
   at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
   at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
   at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
   at org.javassist.tmp.java.lang.Object_$$_javassist_3.search(Object_$$_javassist_3.java)
   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 org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:328)
   at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:341)
   at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
   at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
   at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
   at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
   at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)



Any Clue?

Regards,
Sachin Parnami


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 18, 2008 11:59 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
it looks like the transaction rolled back,
either you did it manually or some other error happened and made the transaction roll back automatically.
In this cases you're not allowed to continue using the session.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 20, 2008 5:05 am 
Beginner
Beginner

Joined: Thu Sep 11, 2008 5:33 am
Posts: 28
Hi Sanne,

Thanks for your reply. How can i find out where it is throwing command to close the session because i have checked application no where i have explicitly closed the session?

Regards,
Sachin Parnami


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 20, 2008 5:10 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Is it possible you didn't open the Session ?

Also check you don't have more exceptions before this stacktrace, as in that case the session gets closed automatically.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 20, 2008 11:00 pm 
Beginner
Beginner

Joined: Thu Sep 11, 2008 5:33 am
Posts: 28
Hi

Thanks for your reply and making me look at application deeply i got the problem have taken
@Persistent Context// EXTENDED
Entity Manager em;

which has actually solved my problem :)

Thanks again


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.