10 Replies Latest reply on Jan 12, 2010 9:55 AM by pieter.martin

    MDB not firing after upgrade to 2.0.0.CR3

    pieter.martin

      Hi,

       

      I have been running hornerq 2.0.0.BETA5 on jboss 5 with seam 2.2.0 and all was ok.

      Today I upgraded to 2.0.0.CR3 and alas now my MDBs are not firing.

       

      I noticed that hornetq-jms.xml has changed somewhat.

       

      My MDB

       

      @MessageDriven(name = "NotificationServiceAlarmMDB", activationConfig = {

      @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),

      @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/AlarmQueue") })

      @Name("notificationServiceMDB")

      @TransactionManagement(TransactionManagementType.BEAN)

      public class NotificationServiceAlarmMDB implements MessageListener {

      ...

      }

       

       

      hornetq-jms.xml I added the following

       

      <queue name="TextQueue">

            <entry name="/queue/TextQueue"/>

         </queue>

       

         <queue name="AlarmForwardQueue">

            <entry name="/queue/AlarmForwardQueue"/>

         </queue>

       

         <queue name="AlarmQueue">

            <entry name="/queue/AlarmQueue"/>

         </queue>

       

         <queue name="AlarmDefinitionQueue">

            <entry name="/queue/AlarmDefinitionQueue"/>

         </queue>

       

      Sending the message to the queue is working fine.

       

      Any ideas as to what can be wrong?

       

      Thanks

      Pieter

        • 1. Re: MDB not firing after upgrade to 2.0.0.CR3
          timfox

          How did you upgrade?

           

          Copying over jars is not sufficient.

           

          You will need to completely re-install HornetQ into JBoss AS by running the script as described in the quick start

          • 2. Re: MDB not firing after upgrade to 2.0.0.CR3
            pieter.martin

            Yeah I did a clean install of jboss 5.1.0.GA, then ran the ejb3 plugin as per http://community.jboss.org/message/73232# and then the hornetq script as per quick start guide.

            • 3. Re: MDB not firing after upgrade to 2.0.0.CR3
              ataylor
              u need to add the "@ResourceAdapter("hornetq-ra.rar")", see the javaee examples in cr3
              • 4. Re: MDB not firing after upgrade to 2.0.0.CR3
                jmesnil
                Did you manage to run the javaee/mdb examples shipped with 2.0.0.CR3?
                • 5. Re: MDB not firing after upgrade to 2.0.0.CR3
                  jaikiran

                  pieter.martin wrote:

                   

                  Hi,

                   


                  @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/AlarmQueue") })

                   

                  ...

                   

                  hornetq-jms.xml I added the following

                   

                     <queue name="AlarmQueue">

                        <entry name="/queue/AlarmQueue"/>

                     </queue>

                   

                   

                  Thanks

                  Pieter

                   

                  I am not much familiar with HornetQ config files, but does that queue configuration in your hornet-jms.xml bind the queue to queue/AlarmQueue jndi-name? I see an additional "/" in that "entry name".

                   

                  Message was edited by: jaikiran pai - I hadn't noticed Jeff's and Andy's reply while posting.

                  • 6. Re: MDB not firing after upgrade to 2.0.0.CR3
                    pieter.martin

                    Hi,

                     

                    Yip that fixed it. Added @ResourceAdapter("hornetq-ra.rar") and all is working again. Is this something new in CR3, is it always required as previously the code was hornetq specifics free?

                     

                    Thanks

                    Pieter

                    • 7. Re: MDB not firing after upgrade to 2.0.0.CR3
                      ataylor

                      its a jboss thing, but we have to deploy the jca adapter as hornetq.rar not jms.rar, we need to leave the default adapter as is. a pain i know. when we fully integrate with jboss this wont be an issue

                      • 8. Re: MDB not firing after upgrade to 2.0.0.CR3
                        pieter.martin

                        Hi,

                         

                        Next issue,

                         

                        16:09:50,308 ERROR [HornetQMessageHandler] Failed to deliver message

                        java.lang.RuntimeException: javax.jms.JMSException: com.rorotika.ns.model.Alarm; local class incompatible: stream classdesc serialVersionUID = -5898672411113034851, local class serialVersionUID = -2513972412587458768

                        at com.rorotika.ns.NotificationServiceAlarmMDB.onMessage(NotificationServiceAlarmMDB.java:38)

                        Seems now it does not like my object anymore. I double checked now, the client and server are both using the same jar. Besides I have not touched that since upgrading.
                        Any ideas?
                        Is it perhaps required to add private static final long serialVersionUID = -2159565720565788581L; to the object now?
                        Thanks
                        Pieter
                        • 9. Re: MDB not firing after upgrade to 2.0.0.CR3
                          timfox

                          This error is not coming from HornetQ, it's just saying you have two versions of your class - with different serialVersionUID.

                           

                          This is just a standard error the Java runtime throws when it detects incompatible classes when deserializing.

                           

                          Either you have two different versions of your jar on your classpath, OR you are trying to consume messages from storage that were originally sent to the queue using a different version of your class.

                           

                           

                           

                          Pieter.martin wrote:

                           

                          Hi,

                           

                          Next issue,

                           

                          16:09:50,308 ERROR [HornetQMessageHandler] Failed to deliver message

                          java.lang.RuntimeException: javax.jms.JMSException: com.rorotika.ns.model.Alarm; local class incompatible: stream classdesc serialVersionUID = -5898672411113034851, local class serialVersionUID = -2513972412587458768

                          at com.rorotika.ns.NotificationServiceAlarmMDB.onMessage(NotificationServiceAlarmMDB.java:38)

                          Seems now it does not like my object anymore. I double checked now, the client and server are both using the same jar. Besides I have not touched that since upgrading.
                          Any ideas?
                          Is it perhaps required to add private static final long serialVersionUID = -2159565720565788581L; to the object now?
                          Thanks
                          Pieter
                          • 10. Re: MDB not firing after upgrade to 2.0.0.CR3
                            pieter.martin

                            Hi,

                             

                            Yes sorry, minor eclipse refactor that did not quite change the pom.xml file making eclipse using a different jar.

                             

                            Thanks

                            Pieter