1 Reply Latest reply on May 7, 2003 10:29 AM by Adrian Brock

    problem with MDB bind on topic

    basley Newbie

      When i deploy a mdb bean (topic) with the following descriptors with jboss 3.2.0 :

      ejb-jar.xml :
      <message-driven >
      <![CDATA[]]>
      <ejb-name>ExecutionReportProcessor</ejb-name> <ejb-class>pm.mdb.ExecutionReportProcessorBean</ejb-class>
      <transaction-type>Container</transaction-type> <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
      <message-driven-destination>
      <destination-type>javax.jms.Topic</destination-type>
      <subscription-durability>Durable</subscription-durability>
      </message-driven-destination>
      <resource-ref >
      <res-ref-name>jms/TopicFactory</res-ref-name>
      <res-type>javax.jms.TopicConnectionFactory</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>
      </message-driven>

      jboss.xml:

      <message-driven>
      <ejb-name>ExecutionReportProcessor</ejb-name> <destination-jndi-name>topic/aremTopic</destination-jndi-name>
      <resource-ref>
      <res-ref-name>jms/TopicFactory</res-ref-name>
      <jndi-name>java:/JmsXA</jndi-name>
      </resource-ref>
      </message-driven>

      I get the message :
      org.jboss.mq.SpyJMSException: Cannot subscribe to this Destination: null; - nested throwable: (java.lang.NullPointerException)
      at org.jboss.mq.Connection.addConsumer(Connection.java:1094)
      at org.jboss.mq.SpyConnectionConsumer.(SpyConnectionConsumer.java:73)

      where as the destination is binding inside jndi, we can use it from an external client.

      It can't be a typo pb, because I use xdocklet.
      If I replace the Topic by a Queue everything is ok !!

      Does anyone know what is wrong ?

        • 1. Re: problem with MDB bind on topic
          Adrian Brock Master

          Compare yours with the testsuite

          ejb-jar.xml
          <ejb-name>DurableTopicBean</ejb-name>
          <ejb-class>org.jboss.test.mdb.bean.TopicBean</ejb-class>
          <message-selector></message-selector>
          <transaction-type>Container</transaction-type>

          <message-driven-destination>
          <destination-type>javax.jms.Topic</destination-type>
          <subscription-durability>Durable</subscription-durability>
          </message-driven-destination>
          </message-driven>

          jboss.xml
          <message-driven>
          <ejb-name>DurableTopicBean</ejb-name>
          <destination-jndi-name>topic/testDurableTopic</destination-jndi-name>
          <mdb-user>john</mdb-user>
          <mdb-passwd>needle</mdb-passwd>
          <mdb-subscription-id>DurableSubscriberExample</mdb-subscription-id>
          </message-driven>

          Regards,
          Adrian