5 Replies Latest reply on May 22, 2013 4:55 PM by rharkar

    Can't get HornetQ working in JBoss4

    petal1

      Hello,

       

      The link below discusses (briefly) how to configure HornetQ to work with JBoss 4.X:

      http://docs.jboss.org/hornetq/2.2.14.Final/quickstart-guide/en/html/running.html

       

      We are using JBoss 4.0.4.GA on OpenSuSE 10.2 with EJB2.1 (yes - that's all very dated now, I am only too aware of that, but please don't reply with unhelpful suggestions to upgrade. We are on the versions we are on).

       

      The documentation states that HornetQ can be used in JBoss 4.X. No minimum value for X is specified. I mention this because there was one other post that said 4.2 was the minimum version. According to the documentation that is not the case.

       

      There are two vital things that I expected to find in the documentation of how to get HornetQ working in JBoss4:

       

           (1) I checked what the differences were between the default configuration and the default-with-hornetq configuration. There are of course new files in the default-with-hornetq folder, but the only file change is to login-config.xml. So when I start JBoss, how does it know to start using HornetQ as the JMS provider rather than JBossMQ?

       

           (2) ith JBossMQ, I defined my destinations in deploy/jms/xxx-jms-service.xml files - how do I migrate those to HornetQ?

       

       

      When starting the default-with-hornetq configuration, it is throwing a few errors on startup.

       

      (1)  11:14:50,581 WARN  [ServiceController] Problem starting service org.hornetq:service=HornetQJMSStarterService java.lang.NoSuchMethodError: org.apache.log4j.Logger.isTraceEnabled()

       

            I replaced the log4j.jar in server/default-with-hornetq/lib with log4j-1.2.17.jar, but still get the same error.

       

      (2) If I drop into deploy my mdb.jar, I get this error:

       

           10:46:23,715 WARN  [JMSContainerInvoker] JMS provider failure detected for Message1Bean

             javax.naming.NameNotFoundException: XAConnectionFactory not bound

       

           even though my jar file does not make any mention of XAConnectionFactory.

       

           I have commented out keepAlive,reconnetInterval, and DLQHandler from conf/standardjboss.xml as instructed here:

           https://community.jboss.org/thread/149163?start=15&tstart=0

       

           I am therefore not too sure what it is about my jar that is causing this error.

       

      (3)  2013-03-20 18:32:53,012 ERROR [STDERR] Mar 20, 2013 6:32:53 PM org.hornetq.core.logging.impl.JULLogDelegate warn

            WARNING: AIO wasn't located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal

       

           I have been unable to install libaio, but it would appear from the error message that this will not be a fatal problem.

       

       

      Any helpful answers gratefully appreciated.

        • 1. Re: Can't get HornetQ working in JBoss4
          ataylor

          JBoss 4 support isn't actively supported in HornetQ, the services that you are using were written by someone from the community so may not work on all versions. However I will try to help

           

            (1) I checked what the differences were between the default configuration and the default-with-hornetq configuration. There are of course new files in the default-with-hornetq folder, but the only file change is to login-config.xml. So when I start JBoss, how does it know to start using HornetQ as the JMS provider rather than JBossMQ?

          It knows becasue the resource adapter would have been replacedjms.rar or hornetq.rar

          (2) ith JBossMQ, I defined my destinations in deploy/jms/xxx-jms-service.xml files - how do I migrate those to HornetQ?

          Theres a section in the docs on configuring destinations, see hornetq-jms.xml

          (1)  11:14:50,581 WARN  [ServiceController] Problem starting service org.hornetq:service=HornetQJMSStarterService java.lang.NoSuchMethodError: org.apache.log4j.Logger.isTraceEnabled()

           

                I replaced the log4j.jar in server/default-with-hornetq/lib with log4j-1.2.17.jar, but still get the same error.

          Im not sure here, I would make sure the version you are using actually has that method, if it does try replacing it in the root lib.

          (2) If I drop into deploy my mdb.jar, I get this error:

           

               10:46:23,715 WARN  [JMSContainerInvoker] JMS provider failure detected for Message1Bean

                 javax.naming.NameNotFoundException: XAConnectionFactory not bound

           

               even though my jar file does not make any mention of XAConnectionFactory.

          The resource adapter uses this so you get this error because of the previous.

          (3)  2013-03-20 18:32:53,012 ERROR [STDERR] Mar 20, 2013 6:32:53 PM org.hornetq.core.logging.impl.JULLogDelegate warn

                WARNING: AIO wasn't located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal

           

               I have been unable to install libaio, but it would appear from the error message that this will not be a fatal problem.

          Yes thats fine it just falls back to NIO

          • 2. Re: Can't get HornetQ working in JBoss4
            petal1

            Thank you, Andy.

             

            You were right about log4j - there is a log4j-boot.jar in the root lib folder that contained the same Logger class.

            If you could bear with me just a bit longer I'd appreciate it as I'm still getting a few errors I don't understand.

            Firstly, given I am using the default-with-hornetq configuration, why am I seeing 'clustered' messages.

             

            I have removed my MDB jar for now to see if hornetq works at all. So this is now just a vanilla install of JBoss 4.0.4 with the configuration create by running hornetq-2.2.14.Final/config/jboss-as-4/build.sh. It still seems to be have a few issues though.

             

            There are a few Stack Traces that appear but they are not marked as "DEBUG" so maybe it is ok?

             

                 2013-03-21 14:40:24,176 DEBUG [org.hornetq.core.paging.cursor.impl.PageCursorProviderImpl] jms.queue.DLQ creating subscription 2 with filter null

                 java.lang.Exception: trace

                     at org.hornetq.core.paging.cursor.impl.PageCursorProviderImpl.createSubscription(PageCursorProviderImpl.java:94)

             

                 2013-03-21 14:40:24,276 DEBUG [org.hornetq.core.postoffice.impl.SimpleAddressManager] Adding binding LocalQueueBinding [address=jms.queue.DLQ, queue=QueueImpl[name=jms.queue.DLQ, postOffice=PostOfficeImpl [server=HornetQServerImpl::serverUUID=9389b2e1-918c-11e2-8f79-    1761f46bbff7]]@e85825, filter=null, name=jms.queue.DLQ, clusterName=jms.queue.DLQ9389b2e1-918c-11e2-8f79-1761f46bbff7] with address = jms.queue.DLQ

                 java.lang.Exception: trace

                     at org.hornetq.core.postoffice.impl.SimpleAddressManager.addBinding(SimpleAddressManager.java:65)

             

            (bit surprised to see clusterName in above message as this is the detault-with-hornetq, which is apparently the "non-clustered" configuration)

             

                 2013-03-21 14:40:42,962 DEBUG [org.hornetq.ra.HornetQResourceAdapter] org.hornetq.integration.jboss.tm.JBoss5TransactionManagerLocator.org.hornetq.integration.jboss.tm.JBoss4TransactionManagerLocator()

                 java.lang.NoSuchMethodException: org.hornetq.integration.jboss.tm.JBoss5TransactionManagerLocator.org.hornetq.integration.jboss.tm.JBoss4TransactionManagerLocator()

                     at java.lang.Class.getMethod(Class.java:1607)

                     at org.hornetq.ra.HornetQResourceAdapter.initialiseTransactionManager(HornetQResourceAdIapter.java:1924)

             

            But then there is an ArrayIndexOutOfBounds that I guess is pretty serious:

                 2013-03-21 14:40:42,963 DEBUG [org.jboss.resource.deployment.RARDeployment] Starting failed jboss.jca:service=RARDeployment,name='jms-ra.rar'

                 java.lang.ArrayIndexOutOfBoundsException: 1

                     at org.hornetq.ra.HornetQResourceAdapter.initialiseTransactionManager(HornetQResourceAdapter.java:1740)

             

            Thank you.

            • 3. Re: Can't get HornetQ working in JBoss4
              ataylor

              these are debug messages that we use, they re not errors.

               

              the last is probably to do with the transactionmanagerlocatorclasss conig on the RA, what do you have this set to?

              • 4. Re: Can't get HornetQ working in JBoss4
                petal1

                I'm not 100% sure that this is what you're asking me for, but...

                 

                in deploy/jms-ra.rar/META-INF/ra.xml, it says:

                <resourceadapter>

                      <config-property>

                        <description>The class that will locate the transactionmanager</description>

                        <config-property-name>TransactionManagerLocatorMethod</config-property-name>

                        <config-property-type>java.lang.String</config-property-type>

                        <config-property-value>org.hornetq.integration.jboss.tm.JBoss4TransactionManagerLocator</config-property-value>

                      </config-property>

                      <config-property>

                        <description>The method to use for locate the transactionmanager</description>

                        <config-property-name>TransactionManagerLocatorMethod</config-property-name>

                        <config-property-type>java.lang.String</config-property-type>

                        <config-property-value>getTm</config-property-value>

                      </config-property>

                 

                I did change this file slightly from the one out the box. When I was having a nose around, I looked in this file and saw that there were a lot of lines with strings of A-circumflex characters, so I removed those characters.

                • 5. Re: Can't get HornetQ working in JBoss4
                  rharkar

                  Andy,

                   

                  I have a question for you . I am creating a new node in JBOSS AS . This is an another server . What stuff I have to move to make hornetQ working

                   

                  I am assuming -

                   

                  a) jms-ra.rar in deploy folder

                  b) hornetq-jms.xml in deploy folder

                  c) hornetq.sar or should i put those XML(hornet-configuration,hornet-jms and jms-ds) files individually in deploy folder.

                  d) modifying the ra.xml

                   

                  And let me know what standard files I need to delete from deploy folder. Your reply would be appreciated .

                   

                  Thanks,

                  RJ