Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-8714

Minion code throws "javax.jms.IllegalStateException: The Session is closed"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 19.0.0
    • Fix Version/s: 19.0.0
    • Component/s: Architecture
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None
    • Sprint:
      Horizon - Nov 30th

      Description

      If you restart OpenNMS while a Minion is attached to it, some of the Minion JMS connections appear to get into an exception state where they throw the following exception during each attempt to send a message once connectivity to OpenNMS is restored:

      016-09-06 14:43:10,256 | WARN  | da://sendMessage | SedaConsumer                     | 63 - org.apache.camel.camel-core - 2.14.1 | Error processing exchange. Exchange[Message: <syslogConnection bytes="XXXXXXXX" location="Home" port="42048" sourceAddress="127.0.0.1" systemId="0d2bc434-4533-11e6-ab01-000c2912c632"/>]. Caused by: [org.springframework.jms.IllegalStateException - The Session is closed; nested exception is javax.jms.IllegalStateException: The Session is closed]
      org.springframework.jms.IllegalStateException: The Session is closed; nested exception is javax.jms.IllegalStateException: The Session is closed
              at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:279)[87:org.apache.servicemix.bundles.spring-jms:3.2.14.RELEASE_1]
              at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)[87:org.apache.servicemix.bundles.spring-jms:3.2.14.RELEASE_1]
              at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:469)[87:org.apache.servicemix.bundles.spring-jms:3.2.14.RELEASE_1]
              at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:228)[65:org.apache.camel.camel-jms:2.14.1]
              at org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:431)[65:org.apache.camel.camel-jms:2.14.1]
              at org.apache.camel.component.jms.JmsProducer.processInOnly(JmsProducer.java:385)[65:org.apache.camel.camel-jms:2.14.1]
              at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:153)[65:org.apache.camel.camel-jms:2.14.1]
              at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:120)[63:org.apache.camel.camel-core:2.14.1]
              at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[63:org.apache.camel.camel-core:2.14.1]
              at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:416)[63:org.apache.camel.camel-core:2.14.1]
              at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[63:org.apache.camel.camel-core:2.14.1]
              at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[63:org.apache.camel.camel-core:2.14.1]
              at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:291)[63:org.apache.camel.camel-core:2.14.1]
              at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:200)[63:org.apache.camel.camel-core:2.14.1]
              at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:147)[63:org.apache.camel.camel-core:2.14.1]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_60]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_60]
              at java.lang.Thread.run(Thread.java:745)[:1.8.0_60]
      Caused by: javax.jms.IllegalStateException: The Session is closed
              at org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:767)[61:org.apache.activemq.activemq-osgi:5.10.0]
              at org.apache.activemq.ActiveMQSession.createQueue(ActiveMQSession.java:1265)[61:org.apache.activemq.activemq-osgi:5.10.0]
              at org.apache.activemq.jms.pool.PooledSession.createQueue(PooledSession.java:194)[61:org.apache.activemq.activemq-osgi:5.10.0]
              at org.springframework.jms.support.destination.DynamicDestinationResolver.resolveQueue(DynamicDestinationResolver.java:101)[87:org.apache.servicemix.bundles.spring-jms:3.2.14.RELEASE_1]
              at org.springframework.jms.support.destination.DynamicDestinationResolver.resolveDestinationName(DynamicDestinationResolver.java:66)[87:org.apache.servicemix.bundles.spring-jms:3.2.14.RELEASE_1]
              at org.springframework.jms.support.destination.JmsDestinationAccessor.resolveDestinationName(JmsDestinationAccessor.java:100)[87:org.apache.servicemix.bundles.spring-jms:3.2.14.RELEASE_1]
              at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$000(JmsConfiguration.java:217)[65:org.apache.camel.camel-jms:2.14.1]
              at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$1.doInJms(JmsConfiguration.java:230)[65:org.apache.camel.camel-jms:2.14.1]
              at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:466)[87:org.apache.servicemix.bundles.spring-jms:3.2.14.RELEASE_1]
              ... 15 more
      

      I think that we need to change the connection pool and/or Camel producer configuration so that it refreshes the connection if a JMS error occurs.

      We should probably, if possible, write a Minion system test that exercises this scenario as well.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                j-white Jesse White
                Reporter:
                seth Seth Leger
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: