3 Replies Latest reply on Apr 12, 2005 9:50 PM by Adrian Brock

    Possible Bug in org.jboss.resource.adapter.jms.inflow.JmsAct

    Felipe Carretero Newbie

      Hi all,

      I am trying to configure a QueueConnectionFactory with an external JMS Provider.
      I getting the following error:

      java.lang.ClassCastException: Object at 'WSMQXAQueueConnectionFactory' in context {java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory, java.naming.provider.url=file:/D:/JNDI-Directory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces} is not an instance of [class=javax.jms.TopicConnectionFactory classloader=org.jboss.mx.loading.UnifiedClassLoader3@fcfa52{ url=file:/D:/jboss-4.0.1sp1/server/default/tmp/deploy/tmp33423jboss-service.xml ,addedOrder=2} interfaces={interface=javax.jms.ConnectionFactory classloader=org.jboss.mx.loading.UnifiedClassLoader3@fcfa52{ url=file:/D:/jboss-4.0.1sp1/server/default/tmp/deploy/tmp33423jboss-service.xml ,addedOrder=2}}] object class is [class=com.ibm.mq.jms.MQXAQueueConnectionFactory classloader=org.jboss.mx.loading.UnifiedClassLoader3@fcfa52{ url=file:/D:/jboss-4.0.1sp1/server/default/tmp/deploy/tmp33423jboss-service.xml ,addedOrder=2} interfaces={interface=javax.jms.XAQueueConnectionFactory classloader=org.jboss.mx.loading.UnifiedClassLoader3@fcfa52{ url=file:/D:/jboss-4.0.1sp1/server/default/tmp/deploy/tmp33423jboss-service.xml ,addedOrder=2}}]


      Looking at the code (org.jboss.resource.adapter.jms.inflow.JmsActivation) I have seen the following:
      protected QueueConnection setupQueueConnection(Context ctx, String user, String pass, String clientID)
       throws Exception
       {
       String queueFactoryRef = adapter.getQueueFactoryRef();
       log.debug("Attempting to lookup queue connection factory " + queueFactoryRef);
       QueueConnectionFactory qcf = (QueueConnectionFactory)Util.lookup(ctx, queueFactoryRef, javax.jms.TopicConnectionFactory.class);
       log.debug("Got queue connection factory " + qcf + " from " + queueFactoryRef);
       log.debug("Attempting to create queue connection with user " + user);
       QueueConnection result;
       if(user != null)
       result = qcf.createQueueConnection(user, pass);
       else
       result = qcf.createQueueConnection();
       if(clientID != null)
       result.setClientID(clientID);
       result.setExceptionListener(this);
       log.debug("Using queue connection " + result);
       return result;
       }


      I think the code should be like:
      QueueConnectionFactory qcf = (QueueConnectionFactory)Util.lookup(ctx, queueFactoryRef, javax.jms.QueueConnectionFactory.class);


      Thx
      Felipe