1 Reply Latest reply on Aug 11, 2014 9:42 AM by Justin Bertram

    Torquebox remote messaging factory setup with rails

    Rowan Smith Newbie

      At the moment we have 2 rails apps. Both running torquebox 3.1.1 Im trying to setup remote messaging from the one app to the other but stuck with this error:

       

          Java::JavaxJms::JMSException (Failed to create session factory):

            org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(org/hornetq/jms/client/HornetQConnectionFactory.java:587)

            org.hornetq.jms.client.HornetQConnectionFactory.createConnection(org/hornetq/jms/client/HornetQConnectionFactory.java:107)

       

      I got the exact error locally and resolved it by adding a connector and acceptor, like so:

       

      Connecting server (standalone.xml):

       

          <hornetq-server>

          ...

          <jms-connection-factories>

              ...

              <connectors>

                  <connector-ref connector-name="netty"/>

                   <connector name="netty">

                       <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

                       <param key="host"  value="${jboss.bind.address:127.0.0.1}"/>

                       <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>

              </connector>

              ...

          </jms-connection-factories>

          </hornetq-server>

       

      Accepting server (standalone.xml):

       

          <hornetq-server>

          ...

          <acceptors>

              ...

              <acceptor name="netty">

                  <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

                   <param key="host"  value="${jboss.bind.address:0.0.0.0}"/> <!-- Do not bind to this IP - set to connector static IP  -->

                   <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>

               </acceptor>

          </acceptors>

          ...

          </hornetq-server>

       

      Expected this to work when setting it up in a staging env.. except it didnt. After adding the connector configuration, starting torquebox it gives the error:

       

          ERROR [org.jboss.as.server] (Controller Boot Thread) JBAS015956: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed to parse configuration

      at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:141) [jboss-as-controller-7.2.x.slim.incremental.16.jar:7.2.x.slim.incremental.16]

      at org.jboss.as.server.ServerService.boot(ServerService.java:308) [jboss-as-server-7.2.x.slim.incremental.16.jar:7.2.x.slim.incremental.16]

      at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:188) [jboss-as-controller-7.2.x.slim.incremental.16.jar:7.2.x.slim.incremental.16]

      at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_55]

          Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[209,32]

          Message: JBAS014788: Unexpected attribute 'name' encountered

      at org.jboss.as.controller.parsing.ParseUtils.unexpectedAttribute(ParseUtils.java:105) [jboss-as-controller-7.2.x.slim.incremental.16.jar:7.2.x.slim.incremental.16]

      at org.jboss.as.messaging.MessagingSubsystemParser.processJmsConnectors(MessagingSubsystemParser.java:1508)

      at org.jboss.as.messaging.MessagingSubsystemParser.createConnectionFactory(MessagingSubsystemParser.java:1545)

      at org.jboss.as.messaging.MessagingSubsystemParser.processConnectionFactory(MessagingSubsystemParser.java:1476)

      at org.jboss.as.messaging.MessagingSubsystemParser.processConnectionFactories(MessagingSubsystemParser.java:810)

       

       

      Firstly, when setting up remote messaging for torquebox with rails are there any additional requirements - like adding the connection factories to the standalone.xml file?

       

      Is there something im missing, how do I overcome the `Failed to create session factory` error?

       

      Help Please!

        • 1. Re: Torquebox remote messaging factory setup with rails
          Justin Bertram Master

          The error message seems pretty clear to me, "Message: JBAS014788: Unexpected attribute 'name' encountered".  I believe this is referring to this bit of XML:

           

              <jms-connection-factories>

                  ...

                  <connectors>

                      <connector-ref connector-name="netty"/>

                       <connector name="netty">

                           <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

                           <param key="host"  value="${jboss.bind.address:127.0.0.1}"/>

                           <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>

                  </connector>

                  ...

              </jms-connection-factories>

           

          You can't actually define the connector itself in the JMS connection factory.  The connector is defined elsewhere in the configuration and then simply referenced by the JMS connection factory.