3 Replies Latest reply on Dec 9, 2009 7:13 AM by Andy Taylor

    MDB annotation/queue creation problem

    Brad N/A Newbie

      Hi,

      I'm having problems getting a simple message driven bean to work in JBoss 5.1.

      Bean annotation:

      @MessageDriven(name = "TestMDB", activationConfig = {
       @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
       @ActivationConfigProperty(propertyName = "destination", propertyValue = "/queue/TestQueue"),
       @ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "true"),
       @ActivationConfigProperty(propertyName = "useLocalTx", propertyValue = "true") })
      


      hornetq-jms.xml file (in the root of my .sar directory):

      <configuration xmlns="urn:hornetq"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
      
       <queue name="testQueue">
       <entry name="/queue/testQueue"/>
       </queue>
      
      </configuration>
      


      The error I'm seeing:

      2009-12-08 17:02:39,872 ERROR [org.hornetq.core.server.impl.ServerSessionImpl](Thread-3 (group:HornetQ-server-threads4863382-274676)) Failed to create consumer
      HornetQException[errorCode=100 message=Binding jms.queue.TestQueue does not exist]
       at org.hornetq.core.server.impl.ServerSessionImpl.doHandleCreateConsumer(ServerSessionImpl.java:1268)
       at org.hornetq.core.server.impl.ServerSessionImpl.handleCreateConsumer(ServerSessionImpl.java:372)
       at org.hornetq.core.server.impl.ServerSessionPacketHandler.handlePacket(ServerSessionPacketHandler.java:117)
       at org.hornetq.core.remoting.impl.ChannelImpl.handlePacket(ChannelImpl.java:606)
       at org.hornetq.core.remoting.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:397)
       at org.hornetq.core.remoting.impl.RemotingConnectionImpl.access$000(RemotingConnectionImpl.java:41)
       at org.hornetq.core.remoting.impl.RemotingConnectionImpl$1.run(RemotingConnectionImpl.java:357)
       at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:96)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
       at java.lang.Thread.run(Thread.java:619)
      2009-12-08 17:02:39,903 ERROR [org.hornetq.ra.inflow.HornetQActivation](WorkManager(2)-1) Unabler to start activation
      HornetQException[errorCode=100 message=Binding jms.queue.TestQueue does not exist]
       at org.hornetq.core.remoting.impl.wireformat.HornetQExceptionMessage.decodeBody(HornetQExceptionMessage.java:79)
       at org.hornetq.core.remoting.impl.wireformat.PacketImpl.decode(PacketImpl.java:214)
       at org.hornetq.core.remoting.impl.PacketDecoder.decode(PacketDecoder.java:435)
       at org.hornetq.core.remoting.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:343)
       at org.hornetq.core.client.impl.ConnectionManagerImpl$DelegatingBufferHandler.bufferReceived(ConnectionManagerImpl.java:1142)
       at org.hornetq.core.remoting.impl.invm.InVMConnection$1.run(InVMConnection.java:127)
       at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:96)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
       at java.lang.Thread.run(Thread.java:619)
      


      The queue definition for /queue/testQueue in the file above seems to be ignored as its no visible in the JNDI tree using the JNDI view MBean. this is puzzling as we have another service deployed with its own hornetq-jms.xml file which is creating queues and topics with no problem.

      Also, I'm curious why its reporting "Binding jms.queue.TestQueue does not exist". That's not the queue name defined in the annotation.

      Can someone point out where I've gone wrong please?

      Thanks,
      Brad.

        • 1. Re: MDB annotation/queue creation problem
          Andy Taylor Master

          check your spelling :) /queue/TestQueue vs /queue/testQueue.

          • 2. Re: MDB annotation/queue creation problem
            Brad N/A Newbie

            Hi Andy,

            thanks for replying. I've corrected the spelling mistake (doh) but I still don't see the queue in JNDI. I also still get the MDB binding error:

            HornetQException[errorCode=100 message=Binding jms.queue.TestQueue does not exist]
            


            Silly question time.....am I allowed to have two hornetq-jms.xml files? Seems strange that I get a queue in JNDI if I put the definition in the other file.

            Also "jms.queue.TestQueue" where does the jms.queue bit come from?

            Cheers.

            • 3. Re: MDB annotation/queue creation problem
              Andy Taylor Master

               

              Silly question time.....am I allowed to have two hornetq-jms.xml files? Seems strange that I get a queue in JNDI if I put the definition in the other file.


              Yes you can. The server will load any file found as a resource on the classpath with this name. Maybe the file not getting picked up is not on the classpath. try moving it.

              Also "jms.queue.TestQueue" where does the jms.queue bit come from?


              This is how we represent jms queue internally. we prefix them with jms.*.

              Are you using JMS on the client side or the core API.