6 Replies Latest reply on Sep 6, 2005 9:22 AM by Darran Lofthouse

    ClassCastException on Queue JNDI lookup

    zach hensley Newbie

      Hello,
      I am getting a ClassCastException when trying to look up a Queue. I am getting the javax.naming.Reference type back instead of the javax.jms.Queue type.

      I am looking up the following queue definition.

      mbean code="org.jboss.mq.server.jmx.Queue"
      name="jboss.mq.destination:service=Queue,name=POSLog"
      depends optional-attribute-name="DestinationManager" jboss.mq:service=DestinationManager /depends
      /mbean


      the Exception is being generated when executing the following client code:

      obj = (Queue) jndiContext.lookup("queue/POSLog");

      and the jdni.properties file looks like:

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.provider.url=jnp://fgrw60205.bscdev.net:1099
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces


      thank you for your help.