14 Replies Latest reply on Jul 5, 2010 9:50 PM by bill.burke

    Problem with HornetQ in AS 6 M3

    andy.miller

      I'm trying to test an application that I was running on EAP 5, on AS 6 M3.  I have a single MDB sitting on a queue called replenish.  During the startup of the server, I'm getting the following exception:

       

      HornetQException[errorCode=105 message=Unable to validate user: null for check type CONSUME for address jms.queue.replenish]
          at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:287) [:6.0.0.20100429-M3]
          at org.hornetq.core.client.impl.ClientSessionImpl.internalCreateConsumer(ClientSessionImpl.java:1556) [:6.0.0.20100429-M3]
          at org.hornetq.core.client.impl.ClientSessionImpl.createConsumer(ClientSessionImpl.java:447) [:6.0.0.20100429-M3]
          at org.hornetq.core.client.impl.ClientSessionImpl.createConsumer(ClientSessionImpl.java:392) [:6.0.0.20100429-M3]
          at org.hornetq.core.client.impl.DelegatingSession.createConsumer(DelegatingSession.java:201) [:6.0.0.20100429-M3]
          at org.hornetq.ra.inflow.HornetQMessageHandler.setup(HornetQMessageHandler.java:168) [:6.0.0.20100429-M3]
          at org.hornetq.ra.inflow.HornetQActivation.setup(HornetQActivation.java:287) [:6.0.0.20100429-M3]
          at org.hornetq.ra.inflow.HornetQActivation$SetupActivation.run(HornetQActivation.java:502) [:6.0.0.20100429-M3]
          at org.jboss.resource.work.WorkWrapper.run(WorkWrapper.java:172) [:6.0.0.20100429-M3]
          at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33) [:6.0.0.20100429-M3]
          at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:780) [:6.0.0.20100429-M3]
          at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45) [:6.0.0.20100429-M3]
          at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:800) [:6.0.0.20100429-M3]
          at java.lang.Thread.run(Thread.java:636) [:1.6.0_18]
          at org.jboss.threads.JBossThread.run(JBossThread.java:122) [:6.0.0.20100429-M3]

       

      I have the following in hornetq-jms.xml:

       

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

       

      At first I thought, because it says "validate user: null", that I have a user problem, so in looking at the documentation, I found out about the hornetq-users.xml file, so I defined the following in that file:

       

      <configuration xmlns="urn:hornetq"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="urn:hornetq ../schemas/hornetq-users.xsd ">

       

          <defaultuser name="guest" password="guest">
              <role name="guest"/>
          </defaultuser>

       

      </configuration>

       

      I can see this has been picked up, as when I looked at the queue in the admin console, its at the bottom under the roles section, with the user "guest", and it says that guest can send and consume messages.

       

      That didn't change anything.  The user still appears to be null, and not guest, even though I created guest as the default user.

       

      Pointers in the right direction would be great.  Thanks.

        • 1. Re: Problem with HornetQ in AS 6 M3
          clebert.suconic

          It seems that the user default doesn't have authorization to that queue.

           

          did you remove the security-settings from hornetq-configuration.xml?

           

           

          You would need at least a matching for this address there.

          • 2. Re: Problem with HornetQ in AS 6 M3
            andy.miller

            Clebert Suconic wrote:

             

            It seems that the user default doesn't have authorization to that queue.

             

            did you remove the security-settings from hornetq-configuration.xml?

             

             

            You would need at least a matching for this address there.

            No, I didn't remove anything from the hornetq-configuration.xml file.  The security settings are as follows in that file:

             

            <security-settings>
                  <security-setting match="#">
                     <permission type="createNonDurableQueue" roles="guest"/>
                     <permission type="deleteNonDurableQueue" roles="guest"/>
                     <permission type="consume" roles="guest"/>
                     <permission type="send" roles="guest"/>
                  </security-setting>
               </security-settings>

             

            I would assume that the # will match any queue I create.  I also changed the ra.xml to add the guest user and password, but all that did was change the user from null in the exception to guest.

             

            Maybe the # doesn't match for some reason?

            • 3. Re: Problem with HornetQ in AS 6 M3
              clebert.suconic

              I believe the null is just that the null user passed through the connection wasn't translated as guest on the message.

               

              Is there a way to replicate this?

              • 4. Re: Problem with HornetQ in AS 6 M3
                andy.miller

                Clebert Suconic wrote:

                 

                I believe the null is just that the null user passed through the connection wasn't translated as guest on the message.

                 

                Is there a way to replicate this?

                I could try to cut things down to the bare minimum so it will deploy without anything having to be added, except the queue.

                 

                One quick question.  There is an attibute defined to disable security.  It seems from the documentation that that attribute (security-enabled) can just be placed anywhere is the file.  Is that correct?

                 

                Maybe I can at least use that as a workaround while we figure out what's going on.

                • 5. Re: Problem with HornetQ in AS 6 M3
                  andy.miller

                  Andrig Miller wrote:

                   

                  Clebert Suconic wrote:

                   

                  I believe the null is just that the null user passed through the connection wasn't translated as guest on the message.

                   

                  Is there a way to replicate this?

                  I could try to cut things down to the bare minimum so it will deploy without anything having to be added, except the queue.

                   

                  One quick question.  There is an attibute defined to disable security.  It seems from the documentation that that attribute (security-enabled) can just be placed anywhere is the file.  Is that correct?

                   

                  Maybe I can at least use that as a workaround while we figure out what's going on.

                  Well, disabling the security worked, as I would expect.  I'll try to get you a simplier EAR file taht will deploy with the only thing special being the queue having to be defined.

                  • 6. Re: Problem with HornetQ in AS 6 M3
                    jaikiran

                    FYI - Another user has reported this exact same issue here http://community.jboss.org/message/542373#542373 and has provided an sample application which shows up this issue.

                    • 7. Re: Problem with HornetQ in AS 6 M3
                      leosbitto

                      Could this possibly be related to https://jira.jboss.org/browse/HORNETQ-340?

                      • 8. Re: Problem with HornetQ in AS 6 M3
                        andy.miller

                        Leos Bitto wrote:

                         

                        Could this possibly be related to https://jira.jboss.org/browse/HORNETQ-340?

                        I don't think so.  I get the exception on deployment, so its a problem way before anything is called, and of course, I don't have a JAAS login module being used by my application.

                        • 9. Re: Problem with HornetQ in AS 6 M3
                          andy.miller

                          jaikiran pai wrote:

                           

                          FYI - Another user has reported this exact same issue here http://community.jboss.org/message/542373#542373 and has provided an sample application which shows up this issue.

                          I have created a simple EJB Jar that also recreates the problem, and can be deployed with no special setup, other than the queue defined for HornetQ.

                          • 10. Re: Problem with HornetQ in AS 6 M3
                            andy.miller

                            Clebert Suconic wrote:

                             

                            I believe the null is just that the null user passed through the connection wasn't translated as guest on the message.

                             

                            Is there a way to replicate this?

                             

                            I have created a very simple EJB jar that recreates the problem.  It just requires you define queue/replenish.  I have attached the jar.  I have also attached the source in a zip.

                            • 11. Re: Problem with HornetQ in AS 6 M3
                              jmesnil

                              This looks like a deployment issues (as discussed in http://community.jboss.org/message/544224#544224).

                               

                              The issue is that MDBs are activated before the HornetQ resources are deployed (queues are not created, roles are not set).

                              In HornetQ 2.1.0.CR1, we have modified HornetQ RA activation so that it will retry until the MDB consumer has been properly created so it should fix your issue (http://fisheye.jboss.org/changelog/Hornetq/?cs=9250)

                              We're also takling to the AS team to fix this the "right" way using dependencies between HornetQ and AS services: http://community.jboss.org/message/544222#544222

                              • 12. Re: Problem with HornetQ in AS 6 M3
                                andy.miller

                                Jeff Mesnil wrote:

                                 

                                This looks like a deployment issues (as discussed in http://community.jboss.org/message/544224#544224).

                                 

                                The issue is that MDBs are activated before the HornetQ resources are deployed (queues are not created, roles are not set).

                                In HornetQ 2.1.0.CR1, we have modified HornetQ RA activation so that it will retry until the MDB consumer has been properly created so it should fix your issue (http://fisheye.jboss.org/changelog/Hornetq/?cs=9250)

                                We're also takling to the AS team to fix this the "right" way using dependencies between HornetQ and AS services: http://community.jboss.org/message/544222#544222

                                Sounds good.  I agree completely that the dependencies should be defined between the services.

                                • 13. Re: Problem with HornetQ in AS 6 M3
                                  bill.burke

                                  I'm getting a similar problem with security enabled in the out-of-the-box, SVN Trunk of AS 6.0 M4.

                                   

                                  1. JBoss is already started when I run my test

                                  2. The invocation is triggered within a Servlet request

                                  3. I am going through the HornetQ core API via the InVM connector

                                   

                                  I set my security domain to be "hornetq" assuming that the default role would be "guest"

                                   

                                  Caused by: HornetQException[errorCode=105 message=Unable to validate user: null for check type CREATE_DURABLE_QUEUE for address jms.topic.testTopic]
                                      at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:287) [:]
                                      at org.hornetq.core.client.impl.ClientSessionImpl.internalCreateQueue(ClientSessionImpl.java:1627) [:]
                                      at org.hornetq.core.client.impl.ClientSessionImpl.createQueue(ClientSessionImpl.java:290) [:]
                                      at org.hornetq.core.client.impl.ClientSessionImpl.createQueue(ClientSessionImpl.java:298) [:]
                                      at org.hornetq.core.client.impl.DelegatingSession.createQueue(DelegatingSession.java:296) [:]
                                      at org.jboss.resteasy.star.messaging.topic.TopicDestinationsResource.createJmsQueue(TopicDestinationsResource.java:61) [:]
                                      ... 34 more

                                  • 14. Re: Problem with HornetQ in AS 6 M3
                                    bill.burke

                                    NVM, i'm an idiot...had to enable "guest" to create/delete durable queues