You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jan Haderka (Created) (JIRA)" <ji...@apache.org> on 2012/03/01 15:25:56 UTC

[jira] [Created] (JCR-3246) RepositoryImpl attempts to close active session twice on shutdown

RepositoryImpl attempts to close active session twice on shutdown
-----------------------------------------------------------------

                 Key: JCR-3246
                 URL: https://issues.apache.org/jira/browse/JCR-3246
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-core
    Affects Versions: 2.4
            Reporter: Jan Haderka
            Priority: Critical


On shutdown sessions are being closed twice which lead to the exception being logged as shown below. As far as I can tell {{RepositoryImpl}} has system sessions in the list of active sessions which is why it tries to close them twice - first time when closing all active sessions {{(RepositoryImpl.java:1078)}} and second time when disposing workspace {{(RepositoryImpl.java:1090)}}.

{noformat}
2012-02-28 10:36:00,614 WARN  org.apache.jackrabbit.core.session.SessionState   : Attempt to close session-31 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-31
	at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:280)
	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:943)
	at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:392)
	at org.apache.jackrabbit.core.security.user.UserManagerImpl.loggedOut(UserManagerImpl.java:1115)
	at org.apache.jackrabbit.core.SessionImpl.notifyLoggedOut(SessionImpl.java:565)
	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:979)
	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doDispose(RepositoryImpl.java:2200)
	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.dispose(RepositoryImpl.java:2154)
	at org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java:1090)
	at org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1041)
	at org.apache.jackrabbit.core.jndi.BindableRepository.shutdown(BindableRepository.java:259)
	at org.apache.jackrabbit.core.jndi.RegistryHelper.unregisterRepository(RegistryHelper.java:94)
       ...
2012-02-28 10:36:00,617 WARN  org.apache.jackrabbit.core.session.SessionState   : session-31 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-31 was originally closed
	at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:275)
	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:943)
	at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:392)
	at org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java:1078)
	at org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1041)
	at org.apache.jackrabbit.core.jndi.BindableRepository.shutdown(BindableRepository.java:259)
	at org.apache.jackrabbit.core.jndi.RegistryHelper.unregisterRepository(RegistryHelper.java:94)
       ...

{noformat}


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3246) UserManagerImpl attempts to close session twice on shutdown

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Guggisberg updated JCR-3246:
-----------------------------------

    Attachment: JCR-3246.patch

proposed patch
                
> UserManagerImpl attempts to close session twice on shutdown
> -----------------------------------------------------------
>
>                 Key: JCR-3246
>                 URL: https://issues.apache.org/jira/browse/JCR-3246
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 2.4
>            Reporter: Jan Haderka
>            Priority: Minor
>         Attachments: JCR-3246.patch
>
>
> On shutdown sessions are being closed twice which lead to the exception being logged as shown below. As far as I can tell {{RepositoryImpl}} has system sessions in the list of active sessions which is why it tries to close them twice - first time when closing all active sessions {{(RepositoryImpl.java:1078)}} and second time when disposing workspace {{(RepositoryImpl.java:1090)}}.
> {noformat}
> 2012-02-28 10:36:00,614 WARN  org.apache.jackrabbit.core.session.SessionState   : Attempt to close session-31 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-31
> 	at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:280)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:943)
> 	at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:392)
> 	at org.apache.jackrabbit.core.security.user.UserManagerImpl.loggedOut(UserManagerImpl.java:1115)
> 	at org.apache.jackrabbit.core.SessionImpl.notifyLoggedOut(SessionImpl.java:565)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:979)
> 	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doDispose(RepositoryImpl.java:2200)
> 	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.dispose(RepositoryImpl.java:2154)
> 	at org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java:1090)
> 	at org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1041)
> 	at org.apache.jackrabbit.core.jndi.BindableRepository.shutdown(BindableRepository.java:259)
> 	at org.apache.jackrabbit.core.jndi.RegistryHelper.unregisterRepository(RegistryHelper.java:94)
>        ...
> 2012-02-28 10:36:00,617 WARN  org.apache.jackrabbit.core.session.SessionState   : session-31 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-31 was originally closed
> 	at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:275)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:943)
> 	at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:392)
> 	at org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java:1078)
> 	at org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1041)
> 	at org.apache.jackrabbit.core.jndi.BindableRepository.shutdown(BindableRepository.java:259)
> 	at org.apache.jackrabbit.core.jndi.RegistryHelper.unregisterRepository(RegistryHelper.java:94)
>        ...
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JCR-3246) RepositoryImpl attempts to close active session twice on shutdown

Posted by "Nick Tuckett (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13418346#comment-13418346 ] 

Nick Tuckett commented on JCR-3246:
-----------------------------------

FWIW I can reproduce this, but in a non-critical situation and without any custom code. I haven't gone out of my way to do this; I came across these kind of log warnings when adding some user management functionality to my application.

With a TransientRepository, log in with an admin session to set up the repository, then acquire the UserManager for that session - this will create a parallel session for the security workspace, referenced by the underlying UserManagerImpl instance. Also, the UserManagerImpl will be added as a SessionListener to the original admin session.

Then with no other sessions active, log the admin session out - this will ultimately iterate through its SessionListeners, calling loggedOut() on each. One such callback will be to the TransientRepository, which will trigger the shutdown (itself logging out any remaining active sessions). Another callback will be to the UserManagerImpl, which will attempt to log out its security session.

It would appear that the order of these callbacks isn't guaranteed, as it can change from run to run. If the TransientRepository callback happens first, it will log out the user manager security session - then the UserManagerImpl callback will occur, attempting to log that session out again, producing the kind of warning log messages described above.

                
> RepositoryImpl attempts to close active session twice on shutdown
> -----------------------------------------------------------------
>
>                 Key: JCR-3246
>                 URL: https://issues.apache.org/jira/browse/JCR-3246
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.4
>            Reporter: Jan Haderka
>            Priority: Critical
>
> On shutdown sessions are being closed twice which lead to the exception being logged as shown below. As far as I can tell {{RepositoryImpl}} has system sessions in the list of active sessions which is why it tries to close them twice - first time when closing all active sessions {{(RepositoryImpl.java:1078)}} and second time when disposing workspace {{(RepositoryImpl.java:1090)}}.
> {noformat}
> 2012-02-28 10:36:00,614 WARN  org.apache.jackrabbit.core.session.SessionState   : Attempt to close session-31 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-31
> 	at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:280)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:943)
> 	at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:392)
> 	at org.apache.jackrabbit.core.security.user.UserManagerImpl.loggedOut(UserManagerImpl.java:1115)
> 	at org.apache.jackrabbit.core.SessionImpl.notifyLoggedOut(SessionImpl.java:565)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:979)
> 	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doDispose(RepositoryImpl.java:2200)
> 	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.dispose(RepositoryImpl.java:2154)
> 	at org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java:1090)
> 	at org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1041)
> 	at org.apache.jackrabbit.core.jndi.BindableRepository.shutdown(BindableRepository.java:259)
> 	at org.apache.jackrabbit.core.jndi.RegistryHelper.unregisterRepository(RegistryHelper.java:94)
>        ...
> 2012-02-28 10:36:00,617 WARN  org.apache.jackrabbit.core.session.SessionState   : session-31 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-31 was originally closed
> 	at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:275)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:943)
> 	at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:392)
> 	at org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java:1078)
> 	at org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1041)
> 	at org.apache.jackrabbit.core.jndi.BindableRepository.shutdown(BindableRepository.java:259)
> 	at org.apache.jackrabbit.core.jndi.RegistryHelper.unregisterRepository(RegistryHelper.java:94)
>        ...
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JCR-3246) UserManagerImpl attempts to close session twice on shutdown

Posted by "Wouter de Vaal (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431669#comment-13431669 ] 

Wouter de Vaal commented on JCR-3246:
-------------------------------------

I can confirm this issue, we are using TransientRepository heavily in unit tests and we get these warnings all over the place. After debugging I spotted the same issue, I am closing the session and jackrabbit is too.
                
> UserManagerImpl attempts to close session twice on shutdown
> -----------------------------------------------------------
>
>                 Key: JCR-3246
>                 URL: https://issues.apache.org/jira/browse/JCR-3246
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 2.4
>            Reporter: Jan Haderka
>            Priority: Minor
>         Attachments: JCR-3246.patch
>
>
> On shutdown sessions are being closed twice which lead to the exception being logged as shown below. As far as I can tell {{RepositoryImpl}} has system sessions in the list of active sessions which is why it tries to close them twice - first time when closing all active sessions {{(RepositoryImpl.java:1078)}} and second time when disposing workspace {{(RepositoryImpl.java:1090)}}.
> {noformat}
> 2012-02-28 10:36:00,614 WARN  org.apache.jackrabbit.core.session.SessionState   : Attempt to close session-31 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-31
> 	at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:280)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:943)
> 	at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:392)
> 	at org.apache.jackrabbit.core.security.user.UserManagerImpl.loggedOut(UserManagerImpl.java:1115)
> 	at org.apache.jackrabbit.core.SessionImpl.notifyLoggedOut(SessionImpl.java:565)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:979)
> 	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doDispose(RepositoryImpl.java:2200)
> 	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.dispose(RepositoryImpl.java:2154)
> 	at org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java:1090)
> 	at org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1041)
> 	at org.apache.jackrabbit.core.jndi.BindableRepository.shutdown(BindableRepository.java:259)
> 	at org.apache.jackrabbit.core.jndi.RegistryHelper.unregisterRepository(RegistryHelper.java:94)
>        ...
> 2012-02-28 10:36:00,617 WARN  org.apache.jackrabbit.core.session.SessionState   : session-31 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-31 was originally closed
> 	at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:275)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:943)
> 	at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:392)
> 	at org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java:1078)
> 	at org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1041)
> 	at org.apache.jackrabbit.core.jndi.BindableRepository.shutdown(BindableRepository.java:259)
> 	at org.apache.jackrabbit.core.jndi.RegistryHelper.unregisterRepository(RegistryHelper.java:94)
>        ...
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (JCR-3246) RepositoryImpl attempts to close active session twice on shutdown

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Guggisberg reopened JCR-3246:
------------------------------------


reopening based on nick's comment/analysis

(thanks, nick!)
                
> RepositoryImpl attempts to close active session twice on shutdown
> -----------------------------------------------------------------
>
>                 Key: JCR-3246
>                 URL: https://issues.apache.org/jira/browse/JCR-3246
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.4
>            Reporter: Jan Haderka
>            Priority: Critical
>
> On shutdown sessions are being closed twice which lead to the exception being logged as shown below. As far as I can tell {{RepositoryImpl}} has system sessions in the list of active sessions which is why it tries to close them twice - first time when closing all active sessions {{(RepositoryImpl.java:1078)}} and second time when disposing workspace {{(RepositoryImpl.java:1090)}}.
> {noformat}
> 2012-02-28 10:36:00,614 WARN  org.apache.jackrabbit.core.session.SessionState   : Attempt to close session-31 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-31
> 	at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:280)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:943)
> 	at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:392)
> 	at org.apache.jackrabbit.core.security.user.UserManagerImpl.loggedOut(UserManagerImpl.java:1115)
> 	at org.apache.jackrabbit.core.SessionImpl.notifyLoggedOut(SessionImpl.java:565)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:979)
> 	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doDispose(RepositoryImpl.java:2200)
> 	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.dispose(RepositoryImpl.java:2154)
> 	at org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java:1090)
> 	at org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1041)
> 	at org.apache.jackrabbit.core.jndi.BindableRepository.shutdown(BindableRepository.java:259)
> 	at org.apache.jackrabbit.core.jndi.RegistryHelper.unregisterRepository(RegistryHelper.java:94)
>        ...
> 2012-02-28 10:36:00,617 WARN  org.apache.jackrabbit.core.session.SessionState   : session-31 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-31 was originally closed
> 	at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:275)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:943)
> 	at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:392)
> 	at org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java:1078)
> 	at org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1041)
> 	at org.apache.jackrabbit.core.jndi.BindableRepository.shutdown(BindableRepository.java:259)
> 	at org.apache.jackrabbit.core.jndi.RegistryHelper.unregisterRepository(RegistryHelper.java:94)
>        ...
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3246) UserManagerImpl attempts to close session twice on shutdown

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Guggisberg updated JCR-3246:
-----------------------------------

    Component/s:     (was: jackrabbit-core)
                 security
       Priority: Minor  (was: Critical)
        Summary: UserManagerImpl attempts to close session twice on shutdown  (was: RepositoryImpl attempts to close active session twice on shutdown)
    
> UserManagerImpl attempts to close session twice on shutdown
> -----------------------------------------------------------
>
>                 Key: JCR-3246
>                 URL: https://issues.apache.org/jira/browse/JCR-3246
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 2.4
>            Reporter: Jan Haderka
>            Priority: Minor
>
> On shutdown sessions are being closed twice which lead to the exception being logged as shown below. As far as I can tell {{RepositoryImpl}} has system sessions in the list of active sessions which is why it tries to close them twice - first time when closing all active sessions {{(RepositoryImpl.java:1078)}} and second time when disposing workspace {{(RepositoryImpl.java:1090)}}.
> {noformat}
> 2012-02-28 10:36:00,614 WARN  org.apache.jackrabbit.core.session.SessionState   : Attempt to close session-31 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-31
> 	at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:280)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:943)
> 	at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:392)
> 	at org.apache.jackrabbit.core.security.user.UserManagerImpl.loggedOut(UserManagerImpl.java:1115)
> 	at org.apache.jackrabbit.core.SessionImpl.notifyLoggedOut(SessionImpl.java:565)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:979)
> 	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doDispose(RepositoryImpl.java:2200)
> 	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.dispose(RepositoryImpl.java:2154)
> 	at org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java:1090)
> 	at org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1041)
> 	at org.apache.jackrabbit.core.jndi.BindableRepository.shutdown(BindableRepository.java:259)
> 	at org.apache.jackrabbit.core.jndi.RegistryHelper.unregisterRepository(RegistryHelper.java:94)
>        ...
> 2012-02-28 10:36:00,617 WARN  org.apache.jackrabbit.core.session.SessionState   : session-31 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-31 was originally closed
> 	at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:275)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:943)
> 	at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:392)
> 	at org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java:1078)
> 	at org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1041)
> 	at org.apache.jackrabbit.core.jndi.BindableRepository.shutdown(BindableRepository.java:259)
> 	at org.apache.jackrabbit.core.jndi.RegistryHelper.unregisterRepository(RegistryHelper.java:94)
>        ...
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (JCR-3246) RepositoryImpl attempts to close active session twice on shutdown

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Guggisberg resolved JCR-3246.
------------------------------------

    Resolution: Cannot Reproduce

RepositoryImpl#activeSessions only contains user-sessions (created through RepositoryImpl#createSession.

the WorkspaceInfo#systemSession instance OTOH is instantiated lazily in WorkspaceInfo#getSystemSession and is *not* added to the RepositoryImpl#activeSessions collection.

the observed behavior is most likely caused by custom code (e.g. derived from RepositoryImpl).
                
> RepositoryImpl attempts to close active session twice on shutdown
> -----------------------------------------------------------------
>
>                 Key: JCR-3246
>                 URL: https://issues.apache.org/jira/browse/JCR-3246
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.4
>            Reporter: Jan Haderka
>            Priority: Critical
>
> On shutdown sessions are being closed twice which lead to the exception being logged as shown below. As far as I can tell {{RepositoryImpl}} has system sessions in the list of active sessions which is why it tries to close them twice - first time when closing all active sessions {{(RepositoryImpl.java:1078)}} and second time when disposing workspace {{(RepositoryImpl.java:1090)}}.
> {noformat}
> 2012-02-28 10:36:00,614 WARN  org.apache.jackrabbit.core.session.SessionState   : Attempt to close session-31 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-31
> 	at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:280)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:943)
> 	at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:392)
> 	at org.apache.jackrabbit.core.security.user.UserManagerImpl.loggedOut(UserManagerImpl.java:1115)
> 	at org.apache.jackrabbit.core.SessionImpl.notifyLoggedOut(SessionImpl.java:565)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:979)
> 	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doDispose(RepositoryImpl.java:2200)
> 	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.dispose(RepositoryImpl.java:2154)
> 	at org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java:1090)
> 	at org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1041)
> 	at org.apache.jackrabbit.core.jndi.BindableRepository.shutdown(BindableRepository.java:259)
> 	at org.apache.jackrabbit.core.jndi.RegistryHelper.unregisterRepository(RegistryHelper.java:94)
>        ...
> 2012-02-28 10:36:00,617 WARN  org.apache.jackrabbit.core.session.SessionState   : session-31 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-31 was originally closed
> 	at org.apache.jackrabbit.core.session.SessionState.close(SessionState.java:275)
> 	at org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:943)
> 	at org.apache.jackrabbit.core.XASessionImpl.logout(XASessionImpl.java:392)
> 	at org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java:1078)
> 	at org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1041)
> 	at org.apache.jackrabbit.core.jndi.BindableRepository.shutdown(BindableRepository.java:259)
> 	at org.apache.jackrabbit.core.jndi.RegistryHelper.unregisterRepository(RegistryHelper.java:94)
>        ...
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira