jakarta-eedeploymentjboss6.xmessage-driven-beandeployment-descriptor

Overwrite annotated Destination of MDB in a deployment descriptor


I developed a Message Driven bean that will now be used for multiple destinations. I want to define the Target Destination not by annotation (which would force me to change the code for each new destination) but in the deployment descriptor. In Java EE 6 the dp should overwrite any annotations.

In my case i created a an ejb-jar and configured my mdb. Unfortunately now two mdbs are deployed. one with the annotated configuration and one from the ejb-jar.

I could easily remove the annotations and stick with the descriptor, but i would like to keep the annotations as "default" values.

Is there a way to reconfigure the annotations of my class?

The mdb will run inside a jboss 6.


Solution

  • As i understand it what i initially intended is not possible. For jboss the annotated configuration is one bean, the deployment descriptor a second bean. The descriptor will merge with certain aspects of the bean configuration if they are not present in xml, but the messagedriven annotation will stay valid.