3 Replies Latest reply on Feb 24, 2017 12:25 PM by jbertram

    javax.jms.JMSException: Failed to create session factory

    lipsotiko

      I am experiencing a JMSException error when using the messaging available in WildFly Full 10.0.0.Final. It appears to occur randomly while the WildFly service is running. Any feedback for how to troubleshoot this error would be helpful. Some of the things I have tried in order to avoid getting this error is reducing the load on the server, however, when increasing the load to force the error to occur is other environments, I get a GC issue rather than the JMSException. I realize this is not a lot of information to go on, I'm just curious if anyone has seen this and has advice.

       

      This warning occurs in some of the logs when the error is thrown:

      2017-02-20 21:35:26,889 WARN  [org.apache.activemq.artemis.core.client] (Thread-1649709) AMQ212054: Destination address=jms.queue.BulkLoad is blocked. If the system is configured to block make sure you consume messages on this configuration.

       

      2017-02-20 23:53:07,703 ERROR [com.emdeon.intellisource.workflow.consumeroutput.BulkLoadQueueConsumerOutput] (Thread-4881523) Exception thrown while posting message to the queue : java:/queue/BulkLoadMDBfor chunk 720: javax.jms.JMSException: Failed to create session factory

        at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:727)

        at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createQueueConnection(ActiveMQConnectionFactory.java:284)

        at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createQueueConnection(ActiveMQConnectionFactory.java:280)

        at com.emdeon.intellisource.workflow.queue.AbstractQueueFacade.processQueue(AbstractQueueFacade.java:50)

        at com.emdeon.intellisource.workflow.consumeroutput.AbstractQueueConsumerOutput.processResults(AbstractQueueConsumerOutput.java:26)

        at com.emdeon.intellisource.workflow.consumeroutput.BulkLoadQueueConsumerOutput.processResults(BulkLoadQueueConsumerOutput.java:30)

        at com.emdeon.intellisource.workflow.handler.ResultsDataHandler.execute(ResultsDataHandler.java:37)

        at org.jbpm.graph.def.Action.execute(Action.java:118)

        at org.jbpm.graph.def.GraphElement.executeActionImpl(GraphElement.java:299)

        at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:266)

        at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:239)

        at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:206)

        at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:188)

        at org.jbpm.graph.def.Transition.take(Transition.java:150)

        at org.jbpm.graph.def.Node.leave(Node.java:450)

        at org.jbpm.graph.exe.Token.signal(Token.java:208)

        at org.jbpm.graph.exe.Token.signal(Token.java:142)

        at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:293)

        at com.emdeon.intellisource.workflow.handler.BPMHandlerProcessor.execute(BPMHandlerProcessor.java:95)

        at com.emdeon.intellisource.workflow.processconsumers.BPMProcessConsumer.run(BPMProcessConsumer.java:52)

      Caused by: ActiveMQConnectionTimedOutException[errorType=CONNECTION_TIMEDOUT message=AMQ119013: Timed out waiting to receive cluster topology. Group:null]

        at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:813)

        at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:724)

        ... 19 more

       

       

      Regards,

      Evangelo

        • 1. Re: javax.jms.JMSException: Failed to create session factory
          jbertram

          2017-02-20 21:35:26,889 WARN [org.apache.activemq.artemis.core.client] (Thread-1649709) AMQ212054: Destination address=jms.queue.BulkLoad is blocked. If the system is configured to block make sure you consume messages on this configuration.

          This is pretty straight-forward.  Check the <address-full-policy> for "jms.queue.BulkLoad" (or perhaps "#").  It's almost certainly BLOCK.  You should either change that to a more appropriate value, increase your <max-size-bytes>, or ensure your message consumers keep up with your message producers so the address doesn't get full.

           

          The stack-trace for your other issue makes me think you might be creating a connection for every message you send (which is an anti-pattern).  Can you check your code to ensure that's not the case?  Also, is the code throwing the exception running on the same server as the message broker or a remote server?

          1 of 1 people found this helpful
          • 2. Re: javax.jms.JMSException: Failed to create session factory
            lipsotiko

            You're 100% right. Instead of creating one connection to queue, there are multiple being created: http://stackoverflow.com/questions/5470691/jms-performance

            The exception is occurring within the same JVM, not a remote server. The <address-full-policy> is set to the default PAGING; to alleviate the issue I increased the <call-timeout> and <max-size-bytes>.

            • 3. Re: javax.jms.JMSException: Failed to create session factory
              jbertram

              Couple of things...

              1. If you're sending messages within the same JVM then you should be using a connection factory with an in-vm connector to avoid unnecessary overhead.
              2. My recommendation would be to use a <pooled-connection-factory>.  This will allow you to leave your code as-is since the pooled-connection-factory will re-use the connection for you behind the scenes.