5 Replies Latest reply on Mar 8, 2004 3:35 AM by Stephane Nicoll

    MDB and dependencies

    snicoll@kiala.com Newbie

      I already asked this a couple of weeks ago but got any answer. I am sorry, I can't find the thread anymore (and it was on the mailing list anyway).

      I have two questions about MDB and dependencies:

      # How can you put a dependencies from an MDB instance to a queue. What happens in my situation is the following scenario:

      - ejb-jar A contains an MDB that is connecting to Queue Q
      - ejb-jar B contains a SAR file that declares the Queue Q

      Both A and B are in the same ear. When I deploy the EAR, the MDB inside A is deployed and since the queue does not exist, JBoss outputs a warning and creates a temporary destination. When the sar file of B is deployed, it crashes because the queue already exist. Is there a way to avoid this. Note that moduel A depends on B (that is Session Beans on A have ejb-externa-ref to session beans contained in B). My ejb-jar are modules so I need to keep the declaration of queues inside the module itself (one solution would be to put a SAR at the EAR level but I cannot afford this)

      # How can you put a depedency from an MDB to a particular J2EE component?

      I have an MDB that needs some session bean to process an incoming request on the queue. When Jboss is started and if messages are on this queue, the MDB starts processing them but fails because he got a NameNotFoundExcetion on the session bean home interface. I've put ejb-ref declaration in the deployment descriptor but it does not seem to help.

      Any idea?