If I remember correct, the example from the manual is about a MDB with container managed TX:
The type of error you get should only ever happen with bean managed TX MDB (getAcknowledgeMode() != MessageDrivenMetaData.CLIENT_ACKNOWLEDGE_MODE)
No, CLIENT_ACKNOWLEDGE_MODE, is not something you may set in the dep descriptor, it is used internaly in the container.
Är you using bean managed TX?
No, i'm not (intentionally :) using BMT.
The bean deploys properly on weblogic using CMT. (But who wants to use weblogic?)
My ejb-jar looks like this:
jboss.xml looks like:
<configuration-name>Standard Message Driven Bean</configuration-name>
Hi, OK should I say congrats or I am sorry? You have actually discovered a bug in the MDB container.
This has been fixed in the main branch, but when it will find it's way into 2.4.0 I do not know.
(The only fix for now is not to use setRollbackOnly, but to throw an EJBException - which will do exactly the same thing).
I am sorry to have caused this, because it is my fault.
Ok. I guess that's a dubious honor.
Is the fix complex, or is there a straightforward issue that a rookie such as myself may be able to address?
Is there a workaround, or is it just not possible to transactionally send messages from an MDB at this point?
It's pretty easy to fix (browse the CVS and make diffs and you get the picture.
It should however work under the following conditions:
- A bean wich inherits the transaction is called, it rolles back the transaction. The transaction in the MDB will the also be rolled back (it does not have to set RollbackOnly.
- The MDB throws an EJBException in onMessage: this will also rollback the message receipt.
Or is this not the behaviour you where looking for?
Remember however, if you constantly rollback the receipt of a message, JBoss will start running in a tight loop, since it will try to send the message on and on.
Basically, if you think you will never have success in receiving the message, you SHOULD receive it, otherwise bad things will happen since JBossMQ does not have a Dead Letter Queue.
I have now merged the chanes into the 2.4.x tree. Either wait for the 2.4.1 relese or check out the 2.4 version (see cvs instructions on how to do that).
A nice feature with the latest 2.4.x is that JBossMQ 1.0 beta is now backported - and this is the fastes, most stable and feature rich version of JBossMQ, EVER.