10 Replies Latest reply on Jan 26, 2011 4:10 PM by vidy5300

    Jboss6 M5 Hornet ResourceAdapter issue -- JMS Queue NOT ready for use

    thunder.farmer

      Hi,

       

        I have a very simple MDB which works fine WITHOUT ResourceAdapter.

        But when I try to access jms queue via ResourceAdapter, I always get the HornetQException[errorCode=105 message=Unable to validate user: guest for check type CONSUME for address jms.

       

      I went through the user manual and other related threads but didn't resolve my problem.

      I set up a /queue/testQueue in the hornetq-jms.xml and all the other files are left to be default.

      Do I miss anything here?

       

      Any pointer to correct direction would be appreciated.

       

      the MDB code are listed below.

       

       

      Thanks,

      Thunder

        • 1. Re: Jboss6 M5 Hornet ResourceAdapter issue
          thunder.farmer

          package thunder.hornetq;
          import javax.ejb.ActivationConfigProperty;
          import javax.ejb.MessageDriven;
          import javax.jms.Message;
          import javax.jms.MessageListener;
          import javax.jms.TextMessage;
          import org.jboss.ejb3.annotation.ResourceAdapter;
          import javax.ejb.TransactionManagement;
          import javax.ejb.TransactionAttributeType;
          import javax.ejb.TransactionAttribute;
          import javax.ejb.TransactionManagementType;
          @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
          @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/testQueue"),
          @ActivationConfigProperty(propertyName = "user", propertyValue = "guest"),
          @ActivationConfigProperty(propertyName = "password", propertyValue = "guest")})
          @TransactionManagement(value= TransactionManagementType.CONTAINER)
          @TransactionAttribute(value= TransactionAttributeType.REQUIRED)
          @ResourceAdapter("jms-ra.rar")
          public class FirstMDB implements MessageListener {
              public FirstMDB() {
             
              }
             
              public void onMessage(Message message) {
                   try { 
             
                      TextMessage textMessage = (TextMessage)message; 
                      String text = textMessage.getText(); 
                      System.out.println("message " + text); 
                   } catch (Exception e) { 
                      e.printStackTrace(); 
                   }
              }
          }

          package thunder.hornetq;

           

          import javax.ejb.ActivationConfigProperty;

          import javax.ejb.MessageDriven;

          import javax.jms.Message;

          import javax.jms.MessageListener;

          import javax.jms.TextMessage;

           

          import org.jboss.ejb3.annotation.ResourceAdapter;

           

          import javax.ejb.TransactionManagement;

          import javax.ejb.TransactionAttributeType;

          import javax.ejb.TransactionAttribute;

          import javax.ejb.TransactionManagementType;

           

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

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

          @ActivationConfigProperty(propertyName = "user", propertyValue = "guest"),

          @ActivationConfigProperty(propertyName = "password", propertyValue = "guest")})

           

          @TransactionManagement(value= TransactionManagementType.CONTAINER)

          @TransactionAttribute(value= TransactionAttributeType.REQUIRED)

          @ResourceAdapter("jms-ra.rar")

          public class FirstMDB implements MessageListener {

           

              public FirstMDB() {

             

              }

           

              public void onMessage(Message message) {

              try { 

             

                      TextMessage textMessage = (TextMessage)message; 

                      String text = textMessage.getText(); 

                      System.out.println("message " + text); 

           

                   } catch (Exception e) { 

                      e.printStackTrace(); 

                   }

              }

           

          }

          • 2. Re: Jboss6 M5 Hornet ResourceAdapter issue
            thunder.farmer

            Exception:

             

            13:57:09,660 INFO  [EJBContainer] STARTED EJB: thunder.hornetq.FirstMDB ejbName: FirstMDB
            13:57:10,253 WARN  [HornetQActivation] Failure in HornetQ activation org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQRe
            sourceAdapter@b1a911 destination=queue/testQueue destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=guest
            password=**** maxSession=15): HornetQException[errorCode=105 message=Unable to validate user: guest for check type CONSUME for address jms.
            queue.testQueue]
                    at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:287) [:6.0.0.20100911-M5]
                    at org.hornetq.core.client.impl.ClientSessionImpl.internalCreateConsumer(ClientSessionImpl.java:1556) [:6.0.0.20100911-M5]
                    at org.hornetq.core.client.impl.ClientSessionImpl.createConsumer(ClientSessionImpl.java:447) [:6.0.0.20100911-M5]
                    at org.hornetq.core.client.impl.ClientSessionImpl.createConsumer(ClientSessionImpl.java:392) [:6.0.0.20100911-M5]
                    at org.hornetq.core.client.impl.DelegatingSession.createConsumer(DelegatingSession.java:201) [:6.0.0.20100911-M5]
                    at org.hornetq.ra.inflow.HornetQMessageHandler.setup(HornetQMessageHandler.java:165) [:6.0.0.20100911-M5]
                    at org.hornetq.ra.inflow.HornetQActivation.setup(HornetQActivation.java:291) [:6.0.0.20100911-M5]
                    at org.hornetq.ra.inflow.HornetQActivation$SetupActivation.run(HornetQActivation.java:573) [:6.0.0.20100911-M5]
                    at org.jboss.resource.work.WorkWrapper.run(WorkWrapper.java:172) [:6.0.0.20100911-M5]
                    at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33) [:6.0.0.20100911-M5]
                    at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:780) [:6.0.0.20100911-M5]
                    at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45) [:6.0.0.20100911-M5]
                    at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:800) [:6.0.0.20100911-M5]
                    at java.lang.Thread.run(Thread.java:619) [:1.6.0_10-rc]
                    at org.jboss.threads.JBossThread.run(JBossThread.java:122) [:6.0.0.20100911-M5]
            13:57:10,690 INFO  [xnio] XNIO Version 2.1.0.CR2
            13:57:10,690 INFO  [nio] XNIO NIO Implementation Version 2.1.0.CR2
            13:57:11,033 INFO  [remoting] JBoss Remoting version 3.1.0.Beta2
            13:57:11,111 INFO  [TomcatDeployment] deploy, ctxPath=/
            13:57:11,391 INFO  [service] Removing bootstrap log handlers
            13:57:11,532 INFO  [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
            13:57:11,641 INFO  [org.apache.coyote.ajp.AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
            13:57:11,641 INFO  [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.0.0.20100911-M5 "Neo"] Started in 1m:6s:452ms
            13:57:12,249 INFO  [org.hornetq.ra.inflow.HornetQActivation] Attempting to reconnect org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.horn
            etq.ra.HornetQResourceAdapter@b1a911 destination=queue/testQueue destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID
            =null user=guest password=**** maxSession=15)
            13:57:12,468 INFO  [org.hornetq.ra.inflow.HornetQActivation] Reconnected with HornetQ

            13:57:09,660 INFO  [EJBContainer] STARTED EJB: thunder.hornetq.FirstMDB ejbName: FirstMDB

            13:57:10,253 WARN  [HornetQActivation] Failure in HornetQ activation org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQRe

            sourceAdapter@b1a911 destination=queue/testQueue destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=guest

            password=**** maxSession=15): HornetQException[errorCode=105 message=Unable to validate user: guest for check type CONSUME for address jms.

            queue.testQueue]

                    at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:287) [:6.0.0.20100911-M5]

                    at org.hornetq.core.client.impl.ClientSessionImpl.internalCreateConsumer(ClientSessionImpl.java:1556) [:6.0.0.20100911-M5]

                    at org.hornetq.core.client.impl.ClientSessionImpl.createConsumer(ClientSessionImpl.java:447) [:6.0.0.20100911-M5]

                    at org.hornetq.core.client.impl.ClientSessionImpl.createConsumer(ClientSessionImpl.java:392) [:6.0.0.20100911-M5]

                    at org.hornetq.core.client.impl.DelegatingSession.createConsumer(DelegatingSession.java:201) [:6.0.0.20100911-M5]

                    at org.hornetq.ra.inflow.HornetQMessageHandler.setup(HornetQMessageHandler.java:165) [:6.0.0.20100911-M5]

                    at org.hornetq.ra.inflow.HornetQActivation.setup(HornetQActivation.java:291) [:6.0.0.20100911-M5]

                    at org.hornetq.ra.inflow.HornetQActivation$SetupActivation.run(HornetQActivation.java:573) [:6.0.0.20100911-M5]

                    at org.jboss.resource.work.WorkWrapper.run(WorkWrapper.java:172) [:6.0.0.20100911-M5]

                    at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33) [:6.0.0.20100911-M5]

                    at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:780) [:6.0.0.20100911-M5]

                    at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45) [:6.0.0.20100911-M5]

                    at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:800) [:6.0.0.20100911-M5]

                    at java.lang.Thread.run(Thread.java:619) [:1.6.0_10-rc]

                    at org.jboss.threads.JBossThread.run(JBossThread.java:122) [:6.0.0.20100911-M5]

             

            13:57:10,690 INFO  [xnio] XNIO Version 2.1.0.CR2

            13:57:10,690 INFO  [nio] XNIO NIO Implementation Version 2.1.0.CR2

            13:57:11,033 INFO  [remoting] JBoss Remoting version 3.1.0.Beta2

            13:57:11,111 INFO  [TomcatDeployment] deploy, ctxPath=/

            13:57:11,391 INFO  [service] Removing bootstrap log handlers

            13:57:11,532 INFO  [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080

            13:57:11,641 INFO  [org.apache.coyote.ajp.AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009

            13:57:11,641 INFO  [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.0.0.20100911-M5 "Neo"] Started in 1m:6s:452ms

            13:57:12,249 INFO  [org.hornetq.ra.inflow.HornetQActivation] Attempting to reconnect org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.horn

            etq.ra.HornetQResourceAdapter@b1a911 destination=queue/testQueue destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID

            =null user=guest password=**** maxSession=15)

            13:57:12,468 INFO  [org.hornetq.ra.inflow.HornetQActivation] Reconnected with HornetQ

            • 3. Re: Jboss6 M5 Hornet ResourceAdapter issue
              clebert.suconic

              You need to setup the user/password at the users properties file. Look at the security integration for AS6. There's probably a doc about it.

              • 4. Re: Jboss6 M5 Hornet ResourceAdapter issue
                shelly.mcgowan
                • 5. Re: Jboss6 M5 Hornet ResourceAdapter issue
                  thunder.farmer

                  Thanks, let me check....

                  • 6. Re: Jboss6 M5 Hornet ResourceAdapter issue
                    thunder.farmer

                    According to my investigation, it turn out to be that this issue has nothing to do with JBoss Security.

                    Seems it exists from M3, http://community.jboss.org/message/544278#544278

                    At the point when JBoss server deploys MDB, the JMS queue is not ready for use.

                     

                    I try it out in below way:

                     

                    1. I start up the JBoss server first, and them deploy(by copying the jar) my MDB to default\deploy. Then everything works fine, no any exception.

                    2. If I deploy the MDB first, and then start up the JBoss server, I always get the exception "HornetQException[errorCode=105 message=Unable to validate user....".

                     

                    Just put the comments here for newbies like me.

                    If anybody has different understandings regards this issue, pls correct me.

                     

                    Thanks.

                    • 7. Jboss6 M5 Hornet ResourceAdapter issue -- JMS Queue NOT ready for use
                      ctron

                      Any news or ideas on this issue?

                       

                      It popped up for me when I upgraded from JBoss AS 6 CR1 to Final. Everything was OK with M5 and CR1 but I can't see any difference.

                       

                      Hope someone can help.

                       

                      tia

                      • 8. Re: Jboss6 M5 Hornet ResourceAdapter issue
                        sappo

                        Hi,

                         

                        for me worked to disable the security in the configuration.xml

                         

                        <security-enabled>false</security-enabled>

                         

                        It's only a workaround, so if someone finds a solution for this problem it would be nice to know.

                         

                        //Kevin

                        • 9. Re: Jboss6 M5 Hornet ResourceAdapter issue
                          ctron

                          Thanks a lot! ... this seems to help. Although I don't understand what is different between CR1 and Final here.

                           

                          My collegue and I can both reproduce this issue starting with the Final release.

                           

                          I hope someone has more details on this topic.

                          • 10. Re: Jboss6 M5 Hornet ResourceAdapter issue
                            vidy5300

                            I have the same issue on the AS 6 final release. I am using Spring JMS, and not an MDB, so the solution described in http://community.jboss.org/message/544278#544278 does not work for me. I am unable to find a solution for this.

                             

                            I will give <security-enabled>false</security-enabled> a try. I too hope that someone would find a solution for this soon.