3 Replies Latest reply on Feb 19, 2007 4:36 PM by Clebert Suconic

    Integration TEsts / Use of other connections

    Clebert Suconic Master

      I have this MDB:

      http://anonsvn.jboss.org/repos/messaging/projects/jms-integration/src/main/org/jboss/test/jms/integration/support/ejb20/TestMessageDriven.java
      And I'm running this on JBoss-4.0.4... with a messaging configuration created by our utils.

      On ejbCreate I'm using other resources such as opening a new connection, as I will answer messages through an answering queue:

       public void ejbCreate() throws EJBException
       {
       try
       {
       ctx = new InitialContext();
       cf = (XAConnectionFactory) ctx.lookup(CONNECTION_FACTORY);
       conn = cf.createXAConnection();
       //ts = messageContext.getTimerService();
       }
       catch (NamingException e)
       {
       throw new EJBException(e);
       }
       catch (JMSException e)
       {
       throw new EJBException(e);
       }
      
       }
      


      When I run this, I'm getting a classCastException:

      Caused by: java.lang.ClassCastException: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl
       at org.jboss.test.messaging.integration.mdb.support.ejb20.TestMessageDriven.ejbCreate(TestMessageDriven.java:81)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.ejb.MessageDrivenEnterpriseContext.<init>(MessageDrivenEnterpriseContext.java:82)
      



      This is bound to java:/JmsXA


      Is this a bug, or I am missing a config here?