Announcement Announcement Module
Collapse
No announcement yet.
Failure to create temporary storage, but error shouldn't happen Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Failure to create temporary storage, but error shouldn't happen

    Hi,

    We're running an ActiveMQ (v 5.5.1-fuse-04-01) broker topology, and A is sending B messages via a topic which is configured by AMQ to be sent to a queue. Also, the AMQ instances are persistent, all with MySQL configurations.

    We're seeing the following stack trace in app B, however:

    Code:
    ERROR 10:07:51,354 [org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] () org.apache.activemq.broker.BrokerService -
    Failed to start ActiveMQ JMS Message Broker.
    Reason: java.lang.RuntimeException: java.io.IOException: Failed to create directory 'activemq-data/localhost/tmp_storage' 
    java.lang.RuntimeException: java.io.IOException: Failed to create directory 'activemq-data/localhost/tmp_storage'
            at org.apache.activemq.broker.BrokerService.getTempDataStore(BrokerService.java:1374)
            at org.apache.activemq.broker.BrokerService.getSystemUsage(BrokerService.java:840)
            at org.apache.activemq.broker.BrokerService.getProducerSystemUsage(BrokerService.java:907)
            at org.apache.activemq.broker.BrokerService.start(BrokerService.java:460)
            at org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(VMTransportFactory.java:123)
            at org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTransportFactory.java:53)
            at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:51)
            at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:80)
            at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:243)
            at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)
            at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:230)
            at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:178)
            at org.springframework.jms.connection.SingleConnectionFactory.doCreateConnection(SingleConnectionFactory.java:342)
            at org.springframework.jms.connection.SingleConnectionFactory.initConnection(SingleConnectionFactory.java:288)
            at org.springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:225)
            at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
            at org.springframework.jms.listener.AbstractJmsListeningContainer.createSharedConnection(AbstractJmsListeningContainer.java:403)
            at org.springframework.jms.listener.AbstractJmsListeningContainer.refreshSharedConnection(AbstractJmsListeningContainer.java:388)
            at org.springframework.jms.listener.DefaultMessageListenerContainer.refreshConnectionUntilSuccessful(DefaultMessageListenerContainer.java:856)
            at org.springframework.jms.listener.DefaultMessageListenerContainer.recoverAfterListenerSetupFailure(DefaultMessageListenerContainer.java:838)
            at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:969)
            at java.lang.Thread.run(Thread.java:662)
    Caused by: java.io.IOException: Failed to create directory 'activemq-data/localhost/tmp_storage'
            at org.apache.activemq.util.IOHelper.mkdirs(IOHelper.java:183)
            at org.apache.activemq.kaha.impl.KahaStore.<init>(KahaStore.java:105)
            at org.apache.activemq.kaha.StoreFactory.open(StoreFactory.java:56)
            at org.apache.activemq.broker.BrokerService.getTempDataStore(BrokerService.java:1372)
            ... 21 more
    WARN 10:07:51,355 [org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] () org.springframework.jms.listener.DefaultMessageListenerContainer -
    Could not refresh JMS Connection for destination 'queue://tsp.to.alfresco.product.flow' - retrying in 5000 ms.
    Cause: Could not create Transport.
    Reason: java.lang.RuntimeException: java.io.IOException: Failed to create directory 'activemq-data/localhost/tmp_storage'
    Here's the app B's entry point:

    Code:
    37     <jms:inbound-channel-adapter destination="a-to-b-incoming-queue"
     38                                   connection-factory="connectionFactory"
     39                                   channel="transformationChannel">
     40     </jms:inbound-channel-adapter>
     41 
     46     <integration:channel id="transformationChannel">
     47         <integration:queue capacity="500"/>
     48     </integration:channel>
     49 
     50     <integration:poller max-messages-per-poll="10" trigger="periodicTrigger" default="true">
     51     </integration:poller>
     52 
     57     <bean id="periodicTrigger" class="org.springframework.scheduling.support.PeriodicTrigger">
     58         <constructor-arg value="10000"/>
     59         <property name="initialDelay" value="180000"/>
     60     </bean>
     61 
     62     <integration:service-activator
     63             input-channel="transformationChannel"
     64             output-channel="toEnrichChannel"
     65             ref="productTOConverter"
     66             method="deserializeItem"/>
     67 
     68 
     69     <integration:channel id="toEnrichChannel"/>
    This is very strange, because KahaDB is typical of either using an embedded broker in app B (which we definitely aren't) or using the default KahaDB if the AMQ instance is persistent (which we definitely aren't, because it's configured to use MySQL).

    Also, the Tomcat user we're running the app as has permissions in all the right places (CATALINA_HOME, CATALINA_BASE, java.io.tmpdir, etc) but this is irrelevant to me. The above error shouldn't happen, because we're not using embedded brokers, or KahaDB in the AMQ instances.

    My question, then: Is there any way Spring Integration or Spring JMS or any of the AMQ stuff it depends on would need local storage? (e.g. when using polling consumers?) Any hints would be greatly appreciated.

  • #2
    No, Spring and Spring Integration are simply JMS clients; it doesn't even know that the provider is ActiveMQ.

    You didn't show your connectionFactory configuration.

    Comment


    • #3
      Thanks for the quick response, Gary.

      Here's the connection factory config:
      Code:
      	<bean id="connectionFactory"
      		class="org.springframework.jms.connection.CachingConnectionFactory">
      		<property name="targetConnectionFactory">
      			<bean class="org.apache.activemq.spring.ActiveMQConnectionFactory">
                      <property name="brokerURL" value="${broker_url}" />
      				<property name="redeliveryPolicy" ref="redeliveryPolicy" />
      			</bean>
      		</property>
      		<property name="cacheProducers" value="${cacheProducers}" />
      		<property name="sessionCacheSize" value="${sessionCacheSize}" />
      		<property name="reconnectOnException" value="${reconnectOnException}" />
      	</bean>
      
      	<!-- http://activemq.apache.org/redelivery-policy.html -->
      	<bean id="redeliveryPolicy" class="org.apache.activemq.RedeliveryPolicy">
      		<property name="maximumRedeliveries" value="${maximumRedeliveries}" />
      		<property name="useExponentialBackOff" value="${useExponentialBackOff}" />
      		<property name="initialRedeliveryDelay" value="${initialRedeliveryDelay}" />
      	</bean>
      ...which uses the following properties:

      broker_url=tcp://live-amq-host:61616
      cacheProducers=true
      sessionCacheSize=1
      reconnectOnException=true
      maximumRedeliveries=2
      useExponentialBackOff=false
      initialRedeliveryDelay=5000

      Comment


      • #4
        Well, I'm not familiar with AMQ internals, but this part of the stack trace seems to indicate an attempt to connect to a broker with a vm: scheme...

        at org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTransportFactory .java:53)
        at org.apache.activemq.transport.TransportFactory.doC onnect(TransportFactory.java:51)
        at org.apache.activemq.transport.TransportFactory.con nect(TransportFactory.java:80)
        at org.apache.activemq.ActiveMQConnectionFactory.crea teTransport(ActiveMQConnectionFactory.java:243)

        Comment


        • #5
          Originally posted by Gary Russell View Post
          Well, I'm not familiar with AMQ internals, but this part of the stack trace seems to indicate an attempt to connect to a broker with a vm: scheme...
          That was indeed the case, thanks Gary.

          (Tomcat process date < property file last changed date, i.e. process was never restarted after reverting from vm:// scheme.)

          Comment

          Working...
          X