activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Lichtin <lich...@yahoo.com.INVALID>
Subject After broker restart, forever seeing 'javax.jms.IllegalStateException: The Session is closed' exceptions
Date Thu, 14 Aug 2014 14:24:27 GMT
The situation I have is a Camel route with a timer: endpoint sending a JMS message every few
seconds.
After stopping/starting the broker, the client does not seem to be able to recover and forever
spits out 


2014-08-14 15:53:55,429 | WARN  | #39 - timer://brokerInfo | TimerConsumer                   
| rg.apache.camel.util.CamelLogger  224 | 117 - org.apache.camel.camel-core - 2.12.4 | Error
processing exchange. Exchange[Message: [Body is null]]. 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)[127:org.springframework.jms:3.2.4.RELEASE]
    at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)[127:org.springframework.jms:3.2.4.RELEASE]
    at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:469)[127:org.springframework.jms:3.2.4.RELEASE]
    at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:228)[128:org.apache.camel.camel-jms:2.12.4]
    at org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:431)[128:org.apache.camel.camel-jms:2.12.4]
    at org.apache.camel.component.jms.JmsProducer.processInOnly(JmsProducer.java:385)[128:org.apache.camel.camel-jms:2.12.4]
    at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:153)[128:org.apache.camel.camel-jms:2.12.4]
    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:113)[117:org.apache.camel.camel-core:2.12.4]
    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[117:org.apache.camel.camel-core:2.12.4]
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[117:org.apache.camel.camel-core:2.12.4]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[117:org.apache.camel.camel-core:2.12.4]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[117:org.apache.camel.camel-core:2.12.4]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[117:org.apache.camel.camel-core:2.12.4]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[117:org.apache.camel.camel-core:2.12.4]
    at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:157)[117:org.apache.camel.camel-core:2.12.4]
    at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:68)[117:org.apache.camel.camel-core:2.12.4]
    at java.util.TimerThread.mainLoop(Timer.java:555)[:1.7.0_55]
    at java.util.TimerThread.run(Timer.java:505)[:1.7.0_55]
Caused by: javax.jms.IllegalStateException: The Session is closed
    at org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:767)[93:org.apache.activemq.activemq-osgi:5.10.0]
    at org.apache.activemq.ActiveMQSession.createQueue(ActiveMQSession.java:1265)[93:org.apache.activemq.activemq-osgi:5.10.0]
    at org.apache.activemq.jms.pool.PooledSession.createQueue(PooledSession.java:194)[93:org.apache.activemq.activemq-osgi:5.10.0]
    at org.springframework.jms.support.destination.DynamicDestinationResolver.resolveQueue(DynamicDestinationResolver.java:101)[127:org.springframework.jms:3.2.4.RELEASE]
    at org.springframework.jms.support.destination.DynamicDestinationResolver.resolveDestinationName(DynamicDestinationResolver.java:66)[127:org.springframework.jms:3.2.4.RELEASE]
    at org.springframework.jms.support.destination.JmsDestinationAccessor.resolveDestinationName(JmsDestinationAccessor.java:100)[127:org.springframework.jms:3.2.4.RELEASE]
    at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$000(JmsConfiguration.java:217)[128:org.apache.camel.camel-jms:2.12.4]
    at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$1.doInJms(JmsConfiguration.java:230)[128:org.apache.camel.camel-jms:2.12.4]
    at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:466)[127:org.springframework.jms:3.2.4.RELEASE]
    ... 15 more



The setup I have (OSGI Blueprint):

    <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL" value="failover:(nio://127.0.0.1:61616)?maxReconnectAttempts=3&amp;startupMaxReconnectAttempts=3&amp;initialReconnectDelay=500"
/>
        <property name="alwaysSyncSend" value="true" />
    </bean>


    <bean id="pooledJmsConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory"
init-method="start" destroy-method="stop">
        <property name="connectionFactory" ref="jmsConnectionFactory" />
        <property name="maxConnections" value="20" />
        <property name="idleTimeout" value="0" />
    </bean>


    <bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
        <property name="connectionFactory" ref="pooledJmsConnectionFactory" />
        <property name="transacted" value="false" />
        <property name="cacheLevelName" value="CACHE_CONSUMER" />
        <property name="concurrentConsumers" value="2" />
        <property name="preserveMessageQos" value="true" />
        <property name="receiveTimeout" value="10000" />
    </bean>


    <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
        <property name="configuration" ref="jmsConfig" />
    </bean>


    <camelContext xmlns="http://camel.apache.org/schema/blueprint" 

        xsi:schemaLocation="http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd"
id="myid">
        <route id="requestBrokerStats">
            <from uri="timer://brokerInfo?fixedRate=true&amp;period=10000"
/>
            <to uri="bean:myBean" />
            <to uri="jms:queue:ActiveMQ.Statistics.Broker?deliveryPersistent=false"
/>
        </route>
    </camelContext>


Any ideas why recovery does not seem to work?

Mime
View raw message