1 Reply Latest reply on Sep 8, 2006 7:22 PM by Elias Ross

    ClassCastException when casting to SpyConnectionFactory

    Rudolf Traunmueller Newbie

      Using following cast

      factory = (SpyConnectionFactory) ctx.lookup("ConnectionFactory");
      

      if always get following classcastexception:
      Caused by: java.lang.ClassCastException: org.jboss.mq.SpyConnectionFactory
       at at.maat.commons.remoting.jms.JMSGateway.start(JMSGateway.java:84)
       ... 20 more
      


      The strange thing is that both, ctx.lookup("ConnectionFactory") and the cast (SpyConnectionFactory) are of type org.jboss.mq.SpyConnectionFactory

      Any ideas?