2 Replies Latest reply on May 23, 2011 3:25 PM by hmusavi

    QueueConnectionFactory problem in JBoss-5.1.0.GA

    hmusavi Newbie

      I am upgrading from JBoss-4.2.3.GA to JBoss-5.1.0.GA. I have the following piece of code that worked fine in JBoss 4 but is giving me QueueConnectionFactory not bound exception in JBoss 5.


      private QueueConnectionFactory queueConnectionFactory;


      I noticed that in JNDI tree for JBoss 5 there is no longer a "QueueConnectionFactory" service in the Global JNDI namesapce but there is still a "ConnectionFactory". I tried changing my code to use "ConnectionFactory" instead and that removed the exception but some functionality is not working any more.


      I see this in the Java namespace though:



      Other components with java:comp namespace
      java:comp namespace of the component jboss.j2ee:ear=eo.ear,jar=tds.jar,name=ServerControllerBean,service=EJB3 :
      +- EJBContext (class: javax.ejb.EJBContext)
      +- TransactionSynchronizationRegistry[link -> java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)
      +- UserTransaction (class: org.jboss.ejb3.tx.UserTransactionImpl)
      +- env (class: org.jnp.interfaces.NamingContext)
       |   +- tds (class: org.jnp.interfaces.NamingContext)
       |   |   +- messageQueue[link -> queue/tds-queue] (class: javax.naming.LinkRef)
       |   +- em (class: org.jboss.jpa.tx.TransactionScopedEntityManager)
       |   +- com.pb.eo.server.tds.framework.server.ejb.ServerControllerBean (class: org.jnp.interfaces.NamingContext)
       |   |   +- sessionContext[link -> java:comp/EJBContext] (class: javax.naming.LinkRef)
       |   |   +- em (class: org.jboss.jpa.tx.TransactionScopedEntityManager)
       |   |   +- queueConnectionFactory[link -> QueueConnectionFactory] (class: javax.naming.LinkRef)


      Any idea would be appreciated. I have tried many things and nothing has been fully working for me.



        • 1. QueueConnectionFactory problem in JBoss-5.1.0.GA
          Mark Paluch Master

          Hi there,

          the JNDI-View shows your registered EJB structure. By default, the JBoss 5 Connection Factories have following mappings:






          (see connection-factories-service.xml)


          so @Resource(mappedName="/ConnectionFactory")

          private ConnectionFactory connectionFactory;


          should work.


          Best regards,


          • 2. Re: QueueConnectionFactory problem in JBoss-5.1.0.GA
            hmusavi Newbie

            Hi Mark,


            Thank you for your reply. I did try your suggestion as well but it still would not work. I was not getting any error but it seems that the message was not being delivered. The onMessage() method of my MDB was never being called. The only way I could get it to work was to add the following to connection-factories-service.xml.



              <mbean code="org.jboss.naming.LinkRefPairService"
                <attribute name="JndiName">QueueConnectionFactory</attribute>
                <attribute name="RemoteJndiName">ConnectionFactory</attribute>
                <attribute name="LocalJndiName">java:/JmsXA</attribute>