6 Replies Latest reply on Apr 21, 2010 5:29 AM by timfox

    Resin and HornetQ

    cstrzadala

      Hello,

       

      I'm attempting to integrate HornetQ with Resin 3.1. I'm new to JMS and am currently finding the config on Resin side somewhat difficult.

       

      I am trying to get a MDB to listen to a JMS queue. I have HornetQ setup as a standalone server with JNDI enabled. After reading through a lot of Resin doco (http://www.icxo.com/resin-doc/tutorial/index.xtp) I have the following in my resin.conf

       

       

           <web-app id="/" document-directory="\D:\dev\app\app_admin\web">
                  <rewrite-dispatch>
                      <redirect regexp='^/$' target='/login'/>
                  </rewrite-dispatch>
                  
                  <connector>
                      <type>org.hornetq.ra.HornetQResourceAdapter</type>
      
                      <resource-adapter>
                        <init>
                          <connection-factory resin:type="org.hornetq.jms.client.HornetQConnectionFactory"/>
                          <destination resin:type="org.hornetq.jms.client.HornetQQueue"/>
                        </init>
                      </resource-adapter>
      
                  </connector>
              </web-app>
      

       

      When I start Resin, it complains that it can't access HornetQResourceAdapter. I have added the following JARS to the resin classpath:

       

      hornetq-core-client.jar
      hornetq-transports.jar
      netty.jar
      hornetq-jms-client.jar
      jnp-client.jar

      hornetq-ra.rar

       

      At this point I'm not sure who to configure resin to access the HornetQResourceAdapter. I have already coded up the MDB with annotations to indicate the queue.

       

      The following is my hornetq-jms.xml

       

      <configuration xmlns="urn:hornetq"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
          
          <connection-factory name="NettyConnectionFactory">
             <connectors>
               <connector-ref connector-name="netty"/>
             </connectors>
              <entries>
                  <entry name="ConnectionFactory"/>
              </entries>
          </connection-factory>
          
          <queue name="AppQueue">
              <entry name="/queue/AppQueue"/>
          </queue>   
          
      </configuration>
      

       

      If anyone is able to help me understand what maybe going wrong with the resin config or if you've done this with resin, some help would be great. If I can get this working, I'll post up the details for future resin uses.

        • 1. Re: Resin and HornetQ
          jaikiran

          Christian Strzadala wrote:

           


          When I start Resin, it complains that it can't access HornetQResourceAdapter. I have added the following JARS to the resin classpath:

           

          hornetq-core-client.jar
          hornetq-transports.jar
          netty.jar
          hornetq-jms-client.jar
          jnp-client.jar

          hornetq-ra.rar

           


          Can you post the entire exception stacktrace and also the exact location where you placed these jars?

          • 2. Re: Resin and HornetQ
            cstrzadala

            After some more experimenting and pulling of hair out with Resin, I've found that:-

             

            - I needed to put the hornetq-ra.rar in the <resin-home>/deploy directory. This allowed resin to deploy the Resource Adapter.

             

            I now have in my resin startup logs the following error:

             

             

            ResourceArchive[HornetQ 2.0 Resource Adapter] loaded
            [17:27:35.182] ResourceArchive[HornetQ 2.0 Resource Adapter] loaded
            [17:27:35.188] ResourceArchive[HornetQ 2.0 Resource Adapter] loaded
            [17:27:35.194] Host[admin.local.app.com] starting
            [17:27:35.563] conf/resin.conf:329: Can't assign true (class java.lang.String) to a class java.lang.Boolean.
            [17:27:35.563] 
            [17:27:35.563] 327: </rewrite-dispatch>
            [17:27:35.563] 328: <connector>
            [17:27:35.563] 329: <type>org.hornetq.ra.HornetQResourceAdapter</type>
            [17:27:35.563] 330: 
            [17:27:35.563] 331: <resource-adapter>
            

             

            This is definitly looking like some crazy Resin config that needs changing. If your able to help that would be great (knowing full well this is a HornetQ forum) as I'd love to have this JMS configuration communicating with HornetQ and then I can work on a message drive bean (trying to then interact with Hibernate Search for replication - more fun to come!)

             

            The following jars are in my Resin classpath (<resin-home>\lib)

             

            hornetq-core-client.jar
            hornetq-transports.jar
            netty.jar
            hornetq-jms-client.jar 
            jnp-client.jar

            • 3. Re: Resin and HornetQ
              clebert.suconic

              I don't see any way around debugging Resin:

               

              someone will need to find why this is happening:

               

              [17:27:35.563] conf/resin.conf:329: Can't assign true (class java.lang.String) to a class java.lang.Boolean.
              
              It could be a pure Resin issue. (no HornetQ involved on this error). Or something caused by the RA setup?
              • 4. Re: Resin and HornetQ
                cstrzadala

                Thanks for all the help with this issue.

                 

                I haven't been able to get Resin configure properly to use HornetQ so I took another option which was that as the application I'm working on uses Spring, I have configured Spring to use HornetQ and utilise Springs Message Driven Pojo (MDP) to listen for messages on the Queue.

                 

                I will be writing up a blog entry about this process for people to give their views on this as an option when wanting to avoid configuration within the App Server for their specific application.

                • 5. Re: Resin and HornetQ
                  timfox

                  Hasn't resin support been able to help you on this?

                   

                  The exception is coming from Resin, not HornetQ, so they should be able at least give you some pointers as to why this is happening.

                  • 6. Re: Resin and HornetQ
                    timfox

                    I used to use Resin many years ago, and IIRC they were always very helpful at resolving user issues.