1 Reply Latest reply on Jun 14, 2007 12:19 PM by Harley Blumenfeld

    Message Driven Bean with TIBCO EMS - Wrong Connection factor

    Harley Blumenfeld Newbie

      In the past we have been using message driven beans with TIBCO EMS integrated directly into our JBoss installations. In order to facilitate this we provide an invoker-bindings tag in the jboss.xml of the ejb's jar like this

      <invoker-bindings>
       <invoker> <invoker-proxy-binding-name>tib-message-driven-bean</invoker-proxy-binding-name>
       </invoker>
      </invoker-bindings>
      
      


      And have the tib-message-driven-bean invoker set up in our standardjboss.xml configuration file.

      This all works well and good for EJB 2.1 style message driven beans.

      On a new project we are trying to use EJB 3.0 and am having trouble using the message driven beans. When trying the following example:

      @MessageDriven(
       activationConfig = {
       @ActivationConfigProperty(propertyName = "destination",
       propertyValue = "ems/queue.sample"),
       @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") }
      )
      public class LoggingMDB implements MessageListener
      {
       private Log mLogger = LogFactory.getLog( LoggingMDB.class );
       public void onMessage( Message message )
       {
       mLogger.info( message.toString() );
       }
      }
      


      The project builds fine but on deployment I get the following exception. It appears that JBoss is looking in the wrong connection factory. How does one specify the connection factory?

      2007-06-14 08:46:39,639 WARN [org.jboss.resource.adapter.jms.inflow.JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@c344b4(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@1501268 destination=ems/queue.sample isTopic=false tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
      java.lang.ClassCastException: com.tibco.tibjms.naming.TibjmsFederatedQueue
      at org.jboss.mq.SpyConnectionConsumer.(SpyConnectionConsumer.java:107)
      at org.jboss.mq.SpyConnection.createConnectionConsumer(SpyConnection.java:128)
      at org.jboss.resource.adapter.jms.inflow.JmsServerSessionPool.setupConsumer(JmsServerSessionPool.java:262)
      at org.jboss.resource.adapter.jms.inflow.JmsServerSessionPool.start(JmsServerSessionPool.java:91)
      at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupSessionPool(JmsActivation.java:536)
      at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:309)
      at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:585)
      at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
      at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
      at java.lang.Thread.run(Thread.java:595)



        • 1. Re: Message Driven Bean with TIBCO EMS - Wrong Connection fa
          Harley Blumenfeld Newbie

          I found the problem... After pouring through the logs and JBoss AS source code I found a place where you can select the jms provider JNDI.

          Changing the annotations to:

          @MessageDriven(
           activationConfig = {
           @ActivationConfigProperty(propertyName = "providerAdapterJNDI", propertyValue = "java:/TibJMSProvider"),
           @ActivationConfigProperty(propertyName = "destination",
           propertyValue = "ems/queue.sample"),
           @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")}
          ))
          


          Fixes the problem.
          Here are the following valid AcitvationConfigProperties that JBoss understands:

          destination
          destinationType
          providerAdapterJNDI
          maxSession