+++ This bug was initially created as a clone of Bug #854102 +++ Description of problem: Platform BZ for GUVNOR-1917 : JackRabbit Session closed problem Steps to Reproduce: 1. shutdown brms-standalone Actual results: Getting 4 WARNs with stacktraces. A) 10:47:07,627 WARN [SessionState] Attempt to close session-admin-3 after it has already been closed. Please review your code for proper session management. java.lang.Exception: Stack trace of the duplicate attempt to close session-admin-3 at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:250) at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:888) at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:389) at org.drools.guvnor.server.repository.RepositoryStartupService.close(RepositoryStartupService.java:176) 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:22) at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) 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:185) at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) at org.drools.guvnor.server.repository.RepositoryStartupService_$$_javassist_seam_2.close(RepositoryStartupService_$$_javassist_seam_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.seam.util.Reflections.invoke(Reflections.java:22) at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) at org.jboss.seam.Component.callComponentMethod(Component.java:2275) at org.jboss.seam.Component.callDestroyMethod(Component.java:2206) at org.jboss.seam.Component.destroy(Component.java:1472) at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:252) at org.jboss.seam.contexts.Lifecycle.endApplication(Lifecycle.java:61) at org.jboss.seam.contexts.ServletLifecycle.endApplication(ServletLifecycle.java:175) at org.jboss.seam.servlet.SeamListener.contextDestroyed(SeamListener.java:41) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3949) B) 10:47:07,631 WARN [SessionState] session-admin-3 has already been closed. See the attached exception for a trace of where this session was closed. java.lang.Exception: Stack trace of where session-admin-3 was originally closed at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:245) at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:888) at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:389) at org.drools.repository.RulesRepository.logout(RulesRepository.java:206) at org.drools.repository.RulesRepository.finalize(RulesRepository.java:1903) at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method) at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83) at java.lang.ref.Finalizer.access$100(Finalizer.java:14) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160) C) 10:47:07,634 WARN [SessionState] Attempt to close session-mailman-4 after it has already been closed. Please review your code for proper session management. java.lang.Exception: Stack trace of the duplicate attempt to close session-mailman-4 at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:250) at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:888) at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:389) at org.drools.repository.RulesRepository.logout(RulesRepository.java:206) at org.drools.guvnor.server.repository.RepositoryStartupService.close(RepositoryStartupService.java:178) 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:22) at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) 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:185) at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) at org.drools.guvnor.server.repository.RepositoryStartupService_$$_javassist_seam_2.close(RepositoryStartupService_$$_javassist_seam_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.seam.util.Reflections.invoke(Reflections.java:22) at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) at org.jboss.seam.Component.callComponentMethod(Component.java:2275) at org.jboss.seam.Component.callDestroyMethod(Component.java:2206) at org.jboss.seam.Component.destroy(Component.java:1472) at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:252) at org.jboss.seam.contexts.Lifecycle.endApplication(Lifecycle.java:61) at org.jboss.seam.contexts.ServletLifecycle.endApplication(ServletLifecycle.java:175) at org.jboss.seam.servlet.SeamListener.contextDestroyed(SeamListener.java:41) D) 10:47:07,643 WARN [SessionState] session-mailman-4 has already been closed. See the attached exception for a trace of where this session was closed. java.lang.Exception: Stack trace of where session-mailman-4 was originally closed at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:245) at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:888) at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:389) at org.apache.jackrabbit.core.TransientRepository.shutdown(TransientRepository.java:408) at org.drools.repository.jackrabbit.JackrabbitRepositoryConfigurator.shutdown(JackrabbitRepositoryConfigurator.java:87) at org.drools.repository.RulesRepositoryConfigurator.shutdown(RulesRepositoryConfigurator.java:171) at org.drools.guvnor.server.repository.RepositoryShutdownService.contextDestroyed(RepositoryShutdownService.java:46) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3949) Expected results: No WARN. --- Additional comment from JBoss JIRA Server on 2012-09-04 00:37:00 EDT --- Toshiya Kobayashi <tkobayas> made a comment on jira GUVNOR-1917 To suppress the WARN, Guvnor may call SessionImpl.isLive() to confirm if it is already closed before calling XASessionImpl.logout(). It wouldn't be much different from what SessionState.close() is doing though :) org.apache.jackrabbit.core.session.SessionState: {noformat} public boolean close() { String session = context.getSessionImpl().toString(); if (!lock.tryLock()) { Exception trace = new Exception( "Stack trace of concurrent access to " + session); log.warn("Attempt to close " + session + " while another" + " thread is concurrently accessing this session." + " Blocking until the other thread is finished" + " using this session. Please review your code" + " to avoid concurrent use of a session.", trace); lock.lock(); } try { if (isAlive()) { closed = new Exception( "Stack trace of where " + session + " was originally closed"); return true; } else { Exception trace = new Exception( "Stack trace of the duplicate attempt to close " + session); log.warn("Attempt to close " + session + " after it has" + " already been closed. Please review your code" + " for proper session management.", trace); log.warn(session + " has already been closed. See the" + " attached exception for a trace of where this" + " session was closed.", closed); return false; } } finally { lock.unlock(); } } {noformat} --- Additional comment from Toshiya Kobayashi on 2012-09-06 02:54:32 EDT --- I believe this WARN doesn't do any harm.
I don't think this applies to BRMS 6, but assigning to Michael to double check.
I agree, since 6.0 doesn't contain Jackrabbit anymore.
Toni Rikkola <toni> updated the status of jira GUVNOR-1917 to Resolved