2 Replies Latest reply on Jul 23, 2012 10:14 AM by derget

    java.lang.LinkageError on MDB

    derget

      Hello community,

       

      I've got two deployed units in jboss-7.1.1 final.

       

      First deployment contains an MDB which refers/extends an abstract MDB

      <code>

      public class MBTopicOutPre421ReceiverBean extends BaseMDB implements MessageListener {

          /**

           * @see MessageListener#onMessage(Message)

           */

          @Override

          public void onMessage(Message rcvMessage) {

          ....

      </code>

       

      In the MAINIFEST.MF I refer via    

      Manifest-Version: 1.0

      Dependencies: deployment.mdb2.jar   

      to the other deployment.

         

      Second jar contains base implemenation (without any deployment descriptor/annotation):

       

      <code>

      public abstract class BaseMDB implements MessageListener {

          private final static Logger LOGGER = Logger.getLogger(BaseMDB.class.getSimpleName());

          /**

           * {@inheritDoc}

           */

          @Override

          public void onMessage(Message msg) {

              LOGGER.info("------->"+msg);

          }

      }

      <code>

       

      I can deploy second jar without problems but when the depending first deployment will be published I get "java.lang.LinkageError" (see attachements for stacktrace).

      It's strange because I used the same strategy with EJB session beans eg. base sessionbean in jar2 and reference form jar1 without any problems.

       

      Any clues?

      Thanx!

        • 1. Re: java.lang.LinkageError on MDB
          leonardo.devai

          Interesting, I work on the exactly same scenario and it works like a charm. I'm even also using 7.1.1.

           

          Did you check if the deployed mdb2.jar was packaged correctly, and it contains the classes on the appropriate structure?

          • 2. Re: java.lang.LinkageError on MDB
            derget

            Hi,

             

            I've created some small projects which only cover the described scenario and it works!

             

            The problem was a missing linebreak after the "Dependencies: deployment.mdbbase.jar".

             

            Thanx a lot for the response.

            Derget