You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Torsten Mielke (JIRA)" <ji...@apache.org> on 2011/08/01 12:41:09 UTC

[jira] [Created] (AMQ-3430) activemq-web: SessionPool.returnSession() should discard sessions that are closed.

activemq-web: SessionPool.returnSession() should discard sessions that are closed. 
-----------------------------------------------------------------------------------

                 Key: AMQ-3430
                 URL: https://issues.apache.org/jira/browse/AMQ-3430
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.5.0, 5.6.0
            Reporter: Torsten Mielke
             Fix For: 5.6.0


In activemq.web project, SessionPool.returnSession() does not check if the session is still open. As long as the session isn't null, its returned back to the pool.
At least one customer reported a problem when using the web console for browsing a queue, where the session was already closed. 

{noformat}
javax.jms.IllegalStateException: The Session is closed
at org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:722)
at org.apache.activemq.ActiveMQSession.createQueue(ActiveMQSession.java:1141)
at org.apache.activemq.web.QueueBrowseQuery.getQueue(QueueBrowseQuery.java:65)
at org.apache.activemq.web.QueueBrowseQuery.createBrowser(QueueBrowseQuery.java:91)
at org.apache.activemq.web.QueueBrowseQuery.getBrowser(QueueBrowseQuery.java:54)
at sun.reflect.GeneratedMethodAccessor125.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)
...
{noformat}

Not sure what triggered the closure of the session, however once it is closed it should not be returned to the pool but be discarded. If its not discarded, then the pool will always return the closed session and any invocations on the session return an exception. Restarting the broker is the only remedy.

 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3430) activemq-web: SessionPool.returnSession() should discard sessions that are closed.

Posted by "Torsten Mielke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13073485#comment-13073485 ] 

Torsten Mielke commented on AMQ-3430:
-------------------------------------

full stack trace of the error reads:

{noformat}
javax.jms.IllegalStateException: The Session is closed
at org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:722)
at org.apache.activemq.ActiveMQSession.createQueue(ActiveMQSession.java:1141)
at org.apache.activemq.web.QueueBrowseQuery.getQueue(QueueBrowseQuery.java:65)
at org.apache.activemq.web.QueueBrowseQuery.createBrowser(QueueBrowseQuery.java:91)
at org.apache.activemq.web.QueueBrowseQuery.getBrowser(QueueBrowseQuery.java:54)
at sun.reflect.GeneratedMethodAccessor125.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:54)
at org.apache.el.parser.AstValue.getValue(AstValue.java:123)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:935)
at org.apache.jsp.browse_jsp._jspx_meth_jms_005fforEachMessage_005f0(browse_jsp.java:169)
at org.apache.jsp.browse_jsp._jspService(browse_jsp.java:103)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.activemq.web.SessionFilter.doFilter(SessionFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.activemq.web.filter.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
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:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:558)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
{noformat}

> activemq-web: SessionPool.returnSession() should discard sessions that are closed. 
> -----------------------------------------------------------------------------------
>
>                 Key: AMQ-3430
>                 URL: https://issues.apache.org/jira/browse/AMQ-3430
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.5.0, 5.6.0
>            Reporter: Torsten Mielke
>              Labels: SessionPool, activemq-web-console,
>             Fix For: 5.6.0
>
>
> In activemq.web project, SessionPool.returnSession() does not check if the session is still open. As long as the session isn't null, its returned back to the pool.
> At least one customer reported a problem when using the web console for browsing a queue, where the session was already closed. 
> {noformat}
> javax.jms.IllegalStateException: The Session is closed
> at org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:722)
> at org.apache.activemq.ActiveMQSession.createQueue(ActiveMQSession.java:1141)
> at org.apache.activemq.web.QueueBrowseQuery.getQueue(QueueBrowseQuery.java:65)
> at org.apache.activemq.web.QueueBrowseQuery.createBrowser(QueueBrowseQuery.java:91)
> at org.apache.activemq.web.QueueBrowseQuery.getBrowser(QueueBrowseQuery.java:54)
> at sun.reflect.GeneratedMethodAccessor125.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)
> ...
> {noformat}
> Not sure what triggered the closure of the session, however once it is closed it should not be returned to the pool but be discarded. If its not discarded, then the pool will always return the closed session and any invocations on the session return an exception. Restarting the broker is the only remedy.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (AMQ-3430) activemq-web: SessionPool.returnSession() should discard sessions that are closed.

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

Dejan Bosanac resolved AMQ-3430.
--------------------------------

    Resolution: Fixed
      Assignee: Dejan Bosanac

Patch committed with svn revision 1152747. Thanks!

> activemq-web: SessionPool.returnSession() should discard sessions that are closed. 
> -----------------------------------------------------------------------------------
>
>                 Key: AMQ-3430
>                 URL: https://issues.apache.org/jira/browse/AMQ-3430
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.5.0, 5.6.0
>            Reporter: Torsten Mielke
>            Assignee: Dejan Bosanac
>              Labels: SessionPool, activemq-web-console,
>             Fix For: 5.6.0
>
>         Attachments: AMQ-3430.patch
>
>
> In activemq.web project, SessionPool.returnSession() does not check if the session is still open. As long as the session isn't null, its returned back to the pool.
> At least one customer reported a problem when using the web console for browsing a queue, where the session was already closed. 
> {noformat}
> javax.jms.IllegalStateException: The Session is closed
> at org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:722)
> at org.apache.activemq.ActiveMQSession.createQueue(ActiveMQSession.java:1141)
> at org.apache.activemq.web.QueueBrowseQuery.getQueue(QueueBrowseQuery.java:65)
> at org.apache.activemq.web.QueueBrowseQuery.createBrowser(QueueBrowseQuery.java:91)
> at org.apache.activemq.web.QueueBrowseQuery.getBrowser(QueueBrowseQuery.java:54)
> at sun.reflect.GeneratedMethodAccessor125.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)
> ...
> {noformat}
> Not sure what triggered the closure of the session, however once it is closed it should not be returned to the pool but be discarded. If its not discarded, then the pool will always return the closed session and any invocations on the session return an exception. Restarting the broker is the only remedy.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AMQ-3430) activemq-web: SessionPool.returnSession() should discard sessions that are closed.

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

Torsten Mielke updated AMQ-3430:
--------------------------------

    Attachment: AMQ-3430.patch

Attaching a possible fix including some logging for SessionPool.java
It was necessary to add a public method ActiveMQSession.isClosed() for checking if a session is closed.



> activemq-web: SessionPool.returnSession() should discard sessions that are closed. 
> -----------------------------------------------------------------------------------
>
>                 Key: AMQ-3430
>                 URL: https://issues.apache.org/jira/browse/AMQ-3430
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.5.0, 5.6.0
>            Reporter: Torsten Mielke
>              Labels: SessionPool, activemq-web-console,
>             Fix For: 5.6.0
>
>         Attachments: AMQ-3430.patch
>
>
> In activemq.web project, SessionPool.returnSession() does not check if the session is still open. As long as the session isn't null, its returned back to the pool.
> At least one customer reported a problem when using the web console for browsing a queue, where the session was already closed. 
> {noformat}
> javax.jms.IllegalStateException: The Session is closed
> at org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:722)
> at org.apache.activemq.ActiveMQSession.createQueue(ActiveMQSession.java:1141)
> at org.apache.activemq.web.QueueBrowseQuery.getQueue(QueueBrowseQuery.java:65)
> at org.apache.activemq.web.QueueBrowseQuery.createBrowser(QueueBrowseQuery.java:91)
> at org.apache.activemq.web.QueueBrowseQuery.getBrowser(QueueBrowseQuery.java:54)
> at sun.reflect.GeneratedMethodAccessor125.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)
> ...
> {noformat}
> Not sure what triggered the closure of the session, however once it is closed it should not be returned to the pool but be discarded. If its not discarded, then the pool will always return the closed session and any invocations on the session return an exception. Restarting the broker is the only remedy.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira