EJB3 MDB und Eclipse 3.4 generiert falchen Code

Alle mögen Eclipse, viel mehr Leute (als früher) mögen EJB 3.
Nur leider fabriziert Eclipse 3.4 falschen Code – zumindestens für das Deployment JBoss 5.1

Es muss nicht heißen

@MessageDriven(
		activationConfig = { 
				@ActivationConfigProperty(
						propertyName = "destinationType", propertyValue = "javax.jms.Queue")
		}, mappedName = "queue/SomeQueue")
public class MyMDB implements MessageListener {

sondern
@MessageDriven(
		activationConfig = { 
			@ActivationConfigProperty(
				propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
			@ActivationConfigProperty(propertyName="destination", propertyValue="queue/SomeQueue")
		})
public class MyMDB implements MessageListener {

Andernfalls gibt es diesen lustigen Stacktrace:

  1. org.jboss.deployers.spi.DeploymentException: Required config property RequiredConfigPropertyMetaData@1aec43[name=destination descriptions=[DescriptionMetaData@7f923d[language=de]]] for messagingType 'javax.jms.MessageListener' not found in activation config [ActivationConfigProperty(destinationType=javax.jms.Queue)] ra=jboss.jca:service=RARDeployment,name='jms-ra.rar'
  2.     at org.jboss.resource.deployment.ActivationSpecFactory.createActivationSpec(ActivationSpecFactory.java:95)
  3.     at org.jboss.resource.deployers.RARDeployment.createActivationSpec(RARDeployment.java:313)
  4.     at org.jboss.resource.deployers.RARDeployment.internalInvoke(RARDeployment.java:276)
  5.     at org.jboss.system.ServiceDynamicMBeanSupport.invoke(ServiceDynamicMBeanSupport.java:156)
  6.     at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
  7.     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
  8.     at org.jboss.ejb3.JmxClientKernelAbstraction.invoke(JmxClientKernelAbstraction.java:58)
  9.     at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.createActivationSpec(JBossMessageEndpointFactory.java:287)
  10.     at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.start(JBossMessageEndpointFactory.java:185)
  11.     ...

Schreibe einen Kommentar