2 Replies Latest reply on Oct 10, 2014 7:46 AM by witoldbudzynski

    Error with HornetQ and EJB

    lusmall

      I am Getting the following Exception when trying to deliver Message to my EJB.

       

      2012-06-07 12:34:28,704 ERROR [org.hornetq.ra.inflow.HornetQMessageHandler] (Thread-3 (group:HornetQ-client-global-threads-30958933)) Failed to deliver message: java.lang.ClassCastException: $Proxy201 cannot be cast to javax.jms.MessageListener

          at org.hornetq.ra.inflow.HornetQMessageHandler.onMessage(HornetQMessageHandler.java:278)

          at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:866) [:6.1.0.Final]

          at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:44) [:6.1.0.Final]

          at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:983) [:6.1.0.Final]

          at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100) [:6.1.0.Final]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_31]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_31]

          at java.lang.Thread.run(Thread.java:662) [:1.6.0_31]

       

      My EJB is a Message Listener :

       

      import javax.ejb.ActivationConfigProperty;

      import javax.ejb.MessageDriven;

      import javax.ejb.TransactionAttribute;

      import javax.ejb.TransactionAttributeType;

      import javax.ejb.TransactionManagement;

      import javax.ejb.TransactionManagementType;

      import javax.jms.Message;

      import javax.jms.MessageListener;

       

      @MessageDriven(mappedName = "/queue/ConnectionQueue", activationConfig = {

              @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),

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

              @ActivationConfigProperty(propertyName = "destination", propertyValue = "ConnectionQueue"),

              @ActivationConfigProperty(propertyName = "useLocalTx", propertyValue = "true")

              }

              , description="Log Connection Starts")

             

      @TransactionManagement(value = TransactionManagementType.CONTAINER)

      @TransactionAttribute(value = TransactionAttributeType.NOT_SUPPORTED)

      public class ConnectionEstablishBean implements MessageListener{

       

         

       

          public ConnectionEstablishBean() {

              super();

          }

       

          public void onMessage(Message arg0) {

              // TODO Auto-generated method stub

       

          }

       

      }

       

      Can anyone tell me What may be my problem here. The Proxied Object that Jboss is giving out has my bean reference but the Cast done in the HornetQHandler is not successful.