1 Reply Latest reply on Apr 25, 2006 6:34 AM by Anders Thörnström

    java.lang.ClassCastException: org.jboss.mq.SpyQueue when cas

    Anders Thörnström Newbie

      Hi
      i have put up a simple message driven bean on AS 4.0.4rc2

      @MessageDriven(activationConfig =
      {
      @ActivationConfigProperty(propertyName="destinationType",
      propertyValue="javax.jms.Queue"),
      @ActivationConfigProperty(propertyName="destination",
      propertyValue="queue/PositioningRequests")
      })
      public class PositioningListner implements MessageListener{
      
       public void onMessage(Message message) {
       TextMessage textMessage = (TextMessage)message;
       System.out.println("Recived Positioning Request for:" +textMessage);
      
       }
      
      }


      this gets deployed fine and the queue gets auto created but when i try to acces it with
      InitialContext ctx = new InitialContext();
       Object obj = ctx.lookup("queue/PositioningRequests");
       System.out.println(obj.getClass());
       javax.jms.Queue queue = (javax.jms.Queue)obj;


      i get java.lang.ClassCastException: org.jboss.mq.SpyQueue
      could it be a classloader problem ?

      /Anders