2 Replies Latest reply on Jan 16, 2003 6:45 AM by Adrian Brock

    Deployment order for jar with MDB and MBean wrong

    Lars Henssen Newbie

      Hi all,

      I found some interesting issue when you try to use a jar file that contains both an MDB and some classes for an MBean.

      I'm not sure whether this is the right forum here or I should post in the JMX forum instead.

      The MDB is packaged inside a jar with the standard ejb-jar.xml and jboss.xml. Since it looks up an object in the JNDI that is started as an MBean, I thought about putting that MBean classes inside the jar file.

      So far so good. Deployment of the MBean starts after the corresponding topic (as referenced in jboss.xml) is started (like with all MDBs).

      But: When you try to use the classes of the MBean from a *-service.xml, thereby referencing the .jar file as the classpath, the deployer starts deploying the whole jar file (including the MDB), though the topic or even the ConnectionFactory is not yet started (results in "javax.naming.NameNotFoundException: ConnectionFactory not bound"). Putting a "depends" element in the *-service.xml doesn't help, since it is only valid for the MBean, not the classpath reference.

      I found a solution for me in putting the classes in different jar files. Nevertheless it would be a good idea to keep the MDB from deploying before the topic is up under all conditions.

      Cheers, Lars