Bug 958404 - JackRabbit Session closed problem
Summary: JackRabbit Session closed problem
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Business Central
Version: 5.x.x
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Jervis Liu
QA Contact: Lukáš Petrovický
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-01 10:41 UTC by Toshiya Kobayashi
Modified: 2018-11-28 19:14 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 854102
Environment:
Last Closed: 2013-07-07 18:18:34 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker GUVNOR-1917 0 Major Resolved JackRabbit Session closed problem 2017-07-03 07:30:38 UTC

Description Toshiya Kobayashi 2013-05-01 10:41:44 UTC
+++ 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.

Comment 1 Edson Tirelli 2013-05-01 14:01:50 UTC
I don't think this applies to BRMS 6, but assigning to Michael to double check.

Comment 3 Lukáš Petrovický 2013-07-07 18:18:34 UTC
I agree, since 6.0 doesn't contain Jackrabbit anymore.

Comment 4 JBoss JIRA Server 2013-11-18 11:08:57 UTC
Toni Rikkola <toni> updated the status of jira GUVNOR-1917 to Resolved


Note You need to log in before you can comment on or make changes to this bug.