2 Replies Latest reply on Sep 12, 2011 10:30 AM by Borisa Zivkovic

    Two problems using MDBs in JBoss 7.0.1

    Borisa Zivkovic Newbie

      Hi everyone,

       

      two problems when porting application from AS6 to AS7

       

      1)

       

      I am not able to inject MessageDrivenContext into MDB (JBoss 7.0.1-Final):

       

      This does not work:

       

      @Resource

      private MessageDrivenContext ctx;

       

       

      I am getting exception

      Can't handle @Resource for ENC name: com.test.testMDB/ctx on class com.test.testMDB since it's missing a "lookup" (or "mappedName") value and isn't of any known type

       

       

      but this

       

      @Resource

      private EJBContext ctx;

       

      does work. This looks strange and probably should be fixed. In AS6 both approaches worked fine.

       

      2)

       

      jboss.xml does not work for defining what queue/topic MDB is listening to. I have to put this information in annotations on MDBs. This is workaround for now but definitely should be fixed. I was not able to find info whether jboss.xml is still valid configuration file for AS7.

       

      thanks

      Borisa