10 Replies Latest reply on Nov 21, 2008 12:14 PM by Jakub Janczak

    How to handle Hibernate Connection

    Benjamin Graf Novice

      I try to use the java.sql.connection of the given Seam entityManager instance to get some information about the used database. But everytime I got an exception:


      [CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@1747815



      I don't know what I'm doing wrong. Maybe there is a better solution without using connection? Any Hibernate specialist out their?

        • 1. Re: How to handle Hibernate Connection
          Keith Naas Novice

          Can you provide your code?


          This kind of error can occur when you obtain a connection without calling close on it - finally is your friend.


          • 2. Re: How to handle Hibernate Connection
            Benjamin Graf Novice

            Closing connection caused error next time entitymanager is used. It seems that no connection is established any more. I'm sorry that I can't post code at the moment. Not working any more at 9pm! :-)

            • 3. Re: How to handle Hibernate Connection
              Keith Naas Novice

              Are you using a connection pool or DataSource?

              • 4. Re: How to handle Hibernate Connection
                Benjamin Graf Novice

                I use the connection from the jboss as.

                • 5. Re: How to handle Hibernate Connection
                  Keith Naas Novice

                  So its a DataSource, the EntityManager should automatically handle closing it.


                  JBoss is simply warning you that a connection wasn't closed when the Connection went out of scope.  The same thing can happen with Statements and ResultSets.


                  Is this masking a different error?  What are the lines in the log above and below this ?


                  • 6. Re: How to handle Hibernate Connection
                    Benjamin Graf Novice

                    I think that it is not masking a different error. The lines above are normal info logs (session initialization) nothing below except of the stacktrace printed by CachedConnectionManager. Anyway is it safe to use the underlying connection directly? Since this error seems to be common (several hints on google) I'm thinking about to get the same result on a different way.

                    • 7. Re: How to handle Hibernate Connection
                      Keith Naas Novice

                      Also, check out the hibernate forums that appear to address this issue

                      • 8. Re: How to handle Hibernate Connection
                        Benjamin Graf Novice

                        Now to make it more precise:


                        
                        @Create
                        
                        public void create() {
                        
                          EntityManager entityManager = (EntityManager) Component.getInstance("entityManager");
                        
                          String persistenceUnitName = null;
                        
                          Object persDelegate = entityManager.getDelegate();
                        
                          if (persDelegate instanceof HibernateSessionProxy) {
                        
                            Connection con = null;
                        
                            ConnectionManager conManager = null;
                        
                            try {
                        
                              conManager = ((HibernateSessionProxy) persDelegate).getJDBCContext().getConnectionManager();
                        
                              con = conManager.borrowConnection();
                        
                              dbInfo = con.getMetaData().getUserName();
                        
                            } catch (Throwable th) {
                        
                              log.error(th.getMessage());
                        
                              dbInfo = "<nicht zu ermitteln>";
                        
                            } finally {
                        
                              if (con != null) {
                        
                                try {
                        
                                  conManager.releaseBorrowedConnection();
                        
                                } catch (Throwable th) {
                        
                                  log.warn(th.getMessage());
                        
                                }
                        
                              }
                        
                            }
                        
                          } else {
                        
                            dbInfo = "<nicht zu ermitteln>";
                        
                          }
                        
                        }



                        First error after session start:



                        09:55:46,899 INFO  [CachedConnectionManager] Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@9f9a41
                        
                        java.lang.Throwable: STACKTRACE
                        
                             at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
                        
                             at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:417)
                        
                             at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
                        
                             at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
                        
                             at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)
                        
                             at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
                        
                             at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
                        
                             at org.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:50)
                        
                             at $Proxy668.getMetaData(Unknown Source)
                        
                             at de.lbb.argon2.utils.properties.Properties4Seam.create(Properties4Seam.java:108)
                        
                             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:597)
                        
                             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.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                        
                             at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
                        
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                        
                             at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
                        
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                        
                             at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                        
                             at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
                        
                             at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
                        
                             at de.lbb.argon2.utils.properties.Properties4Seam_$$_javassist_1.create(Properties4Seam_$$_javassist_1.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:597)
                        
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                        
                             at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
                        
                             at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
                        
                             at org.jboss.seam.Component.callCreateMethod(Component.java:2005)
                        
                             at org.jboss.seam.Component.newInstance(Component.java:1976)
                        
                             at org.jboss.seam.Component.getInstance(Component.java:1873)
                        
                             at org.jboss.seam.Component.getInstance(Component.java:1840)
                        
                             at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
                        
                             at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
                        
                             at org.jboss.seam.Namespace.get(Namespace.java:28)
                        
                             at org.jboss.seam.el.SeamELResolver.resolveInNamespace(SeamELResolver.java:197)
                        
                             at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:57)
                        
                             at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
                        
                             at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
                        
                             at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
                        
                             at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
                        
                             at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
                        
                             at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
                        
                             at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:40)
                        
                             at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
                        
                             at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
                        
                             at javax.faces.component.UIOutput.getValue(UIOutput.java:184)
                        
                             at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:201)
                        
                             at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:284)
                        
                             at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:154)
                        
                             at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:856)
                        
                             at javax.faces.component.UIComponent.encodeAll(UIComponent.java:946)
                        
                             at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
                        
                             at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
                        
                             at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                        
                             at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
                        
                             at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
                        
                             at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                        
                             at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                        
                             at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                        
                             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.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:45)
                        
                             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                        
                             at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
                        
                             at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
                        
                             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.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                        
                             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:619)


                        • 9. Re: How to handle Hibernate Connection
                          Benjamin Graf Novice

                          Second error after clicking in the app:


                          09:55:52,945 INFO  [STDOUT] Hibernate: select appuser0_.ID as ID160_, appuser0_.UUID as UUID160_, appuser0_.accountNonExpired as accountN3_160_, appuser0_.accountNonLocked as accountN4_160_, appuser0_.accountType as accountT5_160_, appuser0_.activationEnd as activati6_160_, appuser0_.activationStart as activati7_160_, appuser0_.creationDate as creation8_160_, appuser0_.email as email160_, appuser0_.enabled as enabled160_, appuser0_.firstname as firstname160_, appuser0_.info as info160_, appuser0_.kube as kube160_, appuser0_.kust as kust160_, appuser0_.lastLoggedIn as lastLog15_160_, appuser0_.lastname as lastname160_, appuser0_.loginCount as loginCount160_, appuser0_.passwort as passwort160_, appuser0_.phone as phone160_, appuser0_.pls as pls160_, appuser0_.salutation as salutation160_, appuser0_.username as username160_ from ARG_APPUSER appuser0_ where appuser0_.username=?
                          
                          09:55:52,961 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
                          
                          09:55:52,961 ERROR [JDBCExceptionReporter] Connection handle has been closed and is unusable
                          
                          09:55:52,961 ERROR [SeamLoginModule] Error invoking login method
                          
                          javax.el.ELException: javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: could not execute query
                          
                               at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:333)
                          
                               at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
                          
                               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 org.jboss.seam.core.Expressions$2.invoke(Expressions.java:173)
                          
                               at org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:109)
                          
                               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:597)
                          
                               at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
                          
                               at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
                          
                               at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
                          
                               at java.security.AccessController.doPrivileged(Native Method)
                          
                               at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
                          
                               at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
                          
                               at org.jboss.seam.security.Identity.authenticate(Identity.java:259)
                          
                               at org.jboss.seam.security.Identity.authenticate(Identity.java:248)
                          
                               at org.jboss.seam.security.Identity.login(Identity.java:205)
                          
                               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:597)
                          
                               at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
                          
                               at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
                          
                               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:88)
                          
                               at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
                          
                               at javax.faces.component.UICommand.broadcast(UICommand.java:387)
                          
                               at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
                          
                               at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
                          
                               at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
                          
                               at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
                          
                               at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                          
                               at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                          
                               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
                          
                               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.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:45)
                          
                               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                          
                               at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
                          
                               at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
                          
                               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.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                          
                               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:619)
                          
                          Caused by: javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: could not execute query
                          
                               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.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
                          
                               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.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
                          
                               at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
                          
                               at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
                          
                               at $Proxy644.authenticate(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:597)
                          
                               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.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                          
                               at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
                          
                               at org.javassist.tmp.java.lang.Object_$$_javassist_2.authenticate(Object_$$_javassist_2.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:597)
                          
                               at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
                          
                               ... 76 more
                          
                          Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
                          
                               at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630)
                          
                               at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:108)
                          
                               at de.lbb.argon2.security.AuthenticatorBeanAction.authenticate(AuthenticatorBeanAction.java:95)
                          
                               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:597)
                          
                               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
                          
                               at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
                          
                               at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
                          
                               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                          
                               at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
                          
                               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                          
                               at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
                          
                               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                          
                               at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
                          
                               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                          
                               at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
                          
                               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                          
                               at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
                          
                               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                          
                               at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                          
                               at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
                          
                               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:597)
                          
                               at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
                          
                               at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
                          
                               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                          
                               at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
                          
                               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                          
                               at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
                          
                               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                          
                               at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
                          
                               ... 109 more
                          
                          Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
                          
                               at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
                          
                               at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
                          
                               at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
                          
                               at org.hibernate.loader.Loader.doList(Loader.java:2223)
                          
                               at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
                          
                               at org.hibernate.loader.Loader.list(Loader.java:2099)
                          
                               at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
                          
                               at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
                          
                               at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
                          
                               at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
                          
                               at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
                          
                               at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:82)
                          
                               ... 142 more
                          
                          Caused by: java.sql.SQLException: Connection handle has been closed and is unusable
                          
                               at org.jboss.resource.adapter.jdbc.WrappedConnection.checkStatus(WrappedConnection.java:537)
                          
                               at org.jboss.resource.adapter.jdbc.WrappedConnection.checkTransaction(WrappedConnection.java:524)
                          
                               at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:184)
                          
                               at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)
                          
                               at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
                          
                               at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
                          
                               at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
                          
                               at org.hibernate.loader.Loader.doQuery(Loader.java:673)
                          
                               at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
                          
                               at org.hibernate.loader.Loader.doList(Loader.java:2220)
                          
                               ... 150 more
                          
                          09:55:53,117 INFO  [STDOUT] Hibernate: select appuser0_.ID as ID160_, appuser0_.UUID as UUID160_, appuser0_.accountNonExpired as accountN3_160_, appuser0_.accountNonLocked as accountN4_160_, appuser0_.accountType as accountT5_160_, appuser0_.activationEnd as activati6_160_, appuser0_.activationStart as activati7_160_, appuser0_.creationDate as creation8_160_, appuser0_.email as email160_, appuser0_.enabled as enabled160_, appuser0_.firstname as firstname160_, appuser0_.info as info160_, appuser0_.kube as kube160_, appuser0_.kust as kust160_, appuser0_.lastLoggedIn as lastLog15_160_, appuser0_.lastname as lastname160_, appuser0_.loginCount as loginCount160_, appuser0_.passwort as passwort160_, appuser0_.phone as phone160_, appuser0_.pls as pls160_, appuser0_.salutation as salutation160_, appuser0_.username as username160_ from ARG_APPUSER appuser0_ where appuser0_.username=?
                          
                          09:55:53,117 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
                          
                          09:55:53,117 ERROR [JDBCExceptionReporter] Connection handle has been closed and is unusable
                          
                          09:55:53,117 ERROR [SeamLoginModule] Error invoking login method
                          
                          javax.el.ELException: javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: could not execute query
                          
                               at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:333)
                          
                               at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
                          
                               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 org.jboss.seam.core.Expressions$2.invoke(Expressions.java:173)
                          
                               at org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:109)
                          
                               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:597)
                          
                               at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
                          
                               at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
                          
                               at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
                          
                               at java.security.AccessController.doPrivileged(Native Method)
                          
                               at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
                          
                               at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
                          
                               at org.jboss.seam.security.Identity.authenticate(Identity.java:259)
                          
                               at org.jboss.seam.security.Identity.authenticate(Identity.java:248)
                          
                               at org.jboss.seam.security.Identity.quietLogin(Identity.java:237)
                          
                               at org.jboss.seam.security.Identity.isLoggedIn(Identity.java:145)
                          
                               at org.jboss.seam.security.Identity.isLoggedIn(Identity.java:135)
                          
                               at sun.reflect.GeneratedMethodAccessor577.invoke(Unknown Source)
                          
                               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                          
                               at java.lang.reflect.Method.invoke(Method.java:597)
                          
                               at javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
                          
                               at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
                          
                               at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
                          
                               at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
                          
                               at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
                          
                               at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
                          
                               at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
                          
                               at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:390)
                          
                               at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
                          
                               at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
                          
                               at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
                          
                               at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                          
                               at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
                          
                               at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
                          
                               at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                          
                               at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                          
                               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                          
                               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.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:45)
                          
                               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                          
                               at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
                          
                               at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
                          
                               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.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                          
                               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:619)
                          
                          Caused by: javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: could not execute query
                          
                               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.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
                          
                               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.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
                          
                               at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
                          
                               at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
                          
                               at $Proxy644.authenticate(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:597)
                          
                               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.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                          
                               at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
                          
                               at org.javassist.tmp.java.lang.Object_$$_javassist_2.authenticate(Object_$$_javassist_2.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:597)
                          
                               at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
                          
                               ... 78 more
                          
                          Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
                          
                               at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630)
                          
                               at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:108)
                          
                               at de.lbb.argon2.security.AuthenticatorBeanAction.authenticate(AuthenticatorBeanAction.java:95)
                          
                               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:597)
                          
                               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
                          
                               at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
                          
                               at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
                          
                               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                          
                               at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
                          
                               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                          
                               at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
                          
                               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                          
                               at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
                          
                               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                          
                               at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
                          
                               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                          
                               at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
                          
                               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                          
                               at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                          
                               at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
                          
                               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:597)
                          
                               at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
                          
                               at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
                          
                               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                          
                               at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
                          
                               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                          
                               at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
                          
                               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                          
                               at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
                          
                               ... 111 more
                          
                          Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
                          
                               at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
                          
                               at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
                          
                               at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
                          
                               at org.hibernate.loader.Loader.doList(Loader.java:2223)
                          
                               at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
                          
                               at org.hibernate.loader.Loader.list(Loader.java:2099)
                          
                               at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
                          
                               at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
                          
                               at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
                          
                               at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
                          
                               at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
                          
                               at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:82)
                          
                               ... 144 more
                          
                          Caused by: java.sql.SQLException: Connection handle has been closed and is unusable
                          
                               at org.jboss.resource.adapter.jdbc.WrappedConnection.checkStatus(WrappedConnection.java:537)
                          
                               at org.jboss.resource.adapter.jdbc.WrappedConnection.checkTransaction(WrappedConnection.java:524)
                          
                               at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:184)
                          
                               at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)
                          
                               at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
                          
                               at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
                          
                               at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
                          
                               at org.hibernate.loader.Loader.doQuery(Loader.java:673)
                          
                               at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
                          
                               at org.hibernate.loader.Loader.doList(Loader.java:2220)
                          
                               ... 152 more

                          • 10. Re: How to handle Hibernate Connection
                            Jakub Janczak Newbie

                            I think setting hibernate property


                            <property name="hibernate.connection.release_mode">after_transaction</property>
                            



                            should help. As a matter of fact Jboss CachedConnectionManager autoClose feature causes some problems, when you are using another hibernate session in the same thread, which is not seam managed. I'm gonna submit a feature fix to Session.disconnect() after the end of the render response phase.