[jboss-user] [EJB 3.0] - Bug : JCA MDB deployment not working with Deployment Descrip

omerlin13 do-not-reply at jboss.com
Wed Jul 16 05:54:41 EDT 2008


Hello,
I have to configure a swiftMQ JCA connector on JBoss 5 ( CR1 release).
It works well when i use annotation.
This works :


package mdb.simple;

import javax.ejb.ActivationConfigProperty;
  | import javax.ejb.MessageDriven;
  | import javax.jms.Message;
  | import javax.jms.MessageListener;
  | import org.jboss.ejb3.annotation.ResourceAdapter;
  | 
  | /**
  |  *
  |  * @author omerlin
  |  */
  | @MessageDriven(name="SimpleMessageEJB", activationConfig =
  | {
  | @ActivationConfigProperty(propertyName="messagingType", propertyValue="javax.jms.MessageListener"),
  | @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
  | @ActivationConfigProperty(propertyName="Destination", propertyValue="testqueue3"),
  | @ActivationConfigProperty(propertyName="ConnectionFactoryName", propertyValue="ConnectionFactory"),
  | @ActivationConfigProperty(propertyName="Transacted", propertyValue="true"),
  | @ActivationConfigProperty(propertyName="Xa", propertyValue="true"),
  | @ActivationConfigProperty(propertyName="DeliveryOption", propertyValue="B"),
  | @ActivationConfigProperty(propertyName="SubscriptionDurability", propertyValue="Durable"),
  | @ActivationConfigProperty(propertyName="MaxPoolSize", propertyValue="20"),
  | @ActivationConfigProperty(propertyName="MaxMessages", propertyValue="1")
  | })
  | @ResourceAdapter("swiftmq.rar")
  | public class SimpleMessageEJBBean implements MessageListener {
  |     
  |     public SimpleMessageEJBBean() {
  |     }
  | 
  |     public void onMessage(Message msg) {
  |          System.out.println("Message received: " + msg);
  |     }
  |     
  | }
  | 

But if you don't want to use the annotations and use the old method of deployment descriptor it fails.
(Note : one reason to use DD is that SystemProperties are substituted here but not in annotations - this would be a nice enhancement )


This code with ejb_jar.xml & jboss.xml fails :
package mdb.simple;
  | 
  | import javax.jms.Message;
  | import javax.jms.MessageListener;
  | 
  | public class SimpleMessageEJBBean implements MessageListener {
  |     
  |     public SimpleMessageEJBBean() {
  |     }
  | 
  |     public void onMessage(Message msg) {
  |          System.out.println("Message received: " + msg);
  |     }
  |     
  | }

ejb_jar.xml :
<?xml version="1.0" encoding="UTF-8"?>
  | <ejb-jar xmlns = "http://java.sun.com/xml/ns/javaee" 
  |          version = "3.0" 
  |          xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" 
  |          xsi:schemaLocation = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
  |     <enterprise-beans>
  |         <message-driven>
  |             <display-name>SimpleMessageEJB</display-name>
  |             <ejb-name>SimpleMessageEJB</ejb-name>
  |             <ejb-class>mdb.simple.SimpleMessageEJBBean</ejb-class>
  |             <messaging-type>javax.jms.MessageListener</messaging-type>
  |             <transaction-type>Container</transaction-type>
  |             <activation-config>
  |                 <activation-config-property>
  |                     <activation-config-property-name>
  |             destinationType
  |                     </activation-config-property-name>
  |                     <activation-config-property-value>
  |             javax.jms.Queue
  |                     </activation-config-property-value>
  |                 </activation-config-property>
  |                 <activation-config-property>
  |                     <activation-config-property-name>
  |             Destination
  |                     </activation-config-property-name>
  |                     <activation-config-property-value>
  |             testqueue3
  |                     </activation-config-property-value>
  |                 </activation-config-property>
  |                 <activation-config-property>
  |                     <activation-config-property-name>
  |             ConnectionFactoryName
  |                     </activation-config-property-name>
  |                     <activation-config-property-value>
  |             ConnectionFactory
  |                     </activation-config-property-value>
  |                 </activation-config-property>
  |                 <activation-config-property>
  |                     <activation-config-property-name>
  |             Transacted
  |                     </activation-config-property-name>
  |                     <activation-config-property-value>
  |             true
  |                     </activation-config-property-value>
  |                 </activation-config-property>
  |                 <activation-config-property>
  |                     <activation-config-property-name>
  |             Xa
  |                     </activation-config-property-name>
  |                     <activation-config-property-value>
  |             true
  |                     </activation-config-property-value>
  |                 </activation-config-property>
  |                 <activation-config-property>
  |                     <activation-config-property-name>
  |             DeliveryOption
  |                     </activation-config-property-name>
  |                     <activation-config-property-value>
  |             B
  |                     </activation-config-property-value>
  |                 </activation-config-property>
  |                 <activation-config-property>
  |                     <activation-config-property-name>
  |             SubscriptionDurability
  |                     </activation-config-property-name>
  |                     <activation-config-property-value>
  |             Durable
  |                     </activation-config-property-value>
  |                 </activation-config-property>
  |                 <activation-config-property>
  |                     <activation-config-property-name>
  |             MaxPoolSize
  |                     </activation-config-property-name>
  |                     <activation-config-property-value>
  |             20
  |                     </activation-config-property-value>
  |                 </activation-config-property>
  |                 <activation-config-property>
  |                     <activation-config-property-name>
  |             MaxMessages
  |                     </activation-config-property-name>
  |                     <activation-config-property-value>
  |             1
  |                     </activation-config-property-value>
  |                 </activation-config-property>
  |             </activation-config>
  |         </message-driven>
  |         
  |     </enterprise-beans>
  | 
  | </ejb-jar>

and jboss.xml :
<?xml version="1.0" encoding="UTF-8"?>
  | <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss_5_0.dtd">
  | <jboss>
  |     <enterprise-beans>
  |         <message-driven>
  |             <ejb-name>SimpleMessageEJB</ejb-name>
  |             <resource-adapter-name>swiftmq.rar</resource-adapter-name>
  |         </message-driven>
  |     </enterprise-beans>
  | </jboss>
  | 


The error we get at deployment time is :

org.jboss.deployment.DeploymentException: Required config property RequiredConfigPropertyMetaData at 1dc0d09[name=ConnectionFactoryName descriptions=[DescriptionMetaData at 87c7a8[language=en]]] for messagingType 'javax.jms.MessageListener' not found in activation config [ActivationConfigProperty(
  |             destinationType
  |                     =
  |             javax.jms.Queue
  |                     ), ActivationConfigProperty(
  |             Destination
  |                     =
  |             testqueue3
  |                     ), ActivationConfigProperty(
  |             Xa
  |                     =
  |             true
  |                     ), ActivationConfigProperty(
  |             Transacted
  |                     =
  |             true
  |                     ), ActivationConfigProperty(
  |             ConnectionFactoryName
  |                     =
  |             ConnectionFactory
  |                     ), ActivationConfigProperty(subscriptionDurability=false), ActivationConfigProperty(
  |             MaxPoolSize
  |                     =
  |             20
  |                     ), ActivationConfigProperty(
  |             DeliveryOption
  |                     =
  |             B
  |                     ), ActivationConfigProperty(
  |             MaxMessages
  |                     =
  |             1
  |                     ), ActivationConfigProperty(
  |             SubscriptionDurability
  |                     =
  |             Durable
  |                     )] ra=jboss.jca:service=RARDeployment,name='swiftmq.rar'
  |         at org.jboss.resource.deployment.ActivationSpecFactory.createActivationSpec(ActivationSpecFactory.java:95)
  |         at org.jboss.resource.deployers.RARDeployment.createActivationSpec(RARDeployment.java:312)
  |         at org.jboss.resource.deployers.RARDeployment.internalInvoke(RARDeployment.java:276)
  |         at org.jboss.system.ServiceDynamicMBeanSupport.invoke(ServiceDynamicMBeanSupport.java:156)
  |         at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
  |         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
  |         at org.jboss.ejb3.JmxClientKernelAbstraction.invoke(JmxClientKernelAbstraction.java:58)
  |         at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.createActivationSpec(JBossMessageEndpointFactory.java:287)
  |         at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.start(JBossMessageEndpointFactory.java:185)
  |         at org.jboss.ejb3.mdb.MessagingContainer.startProxies(MessagingContainer.java:203)
  |         at org.jboss.ejb3.mdb.MessagingContainer.start(MessagingContainer.java:172)
  |         at org.jboss.ejb3.mdb.MDB.start(MDB.java:138)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:597)
  |         at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56)
  |         at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
  |         at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
  |         at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
  |         at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
  |         at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
  |         at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
  |         at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
  |         at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
  |         at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
  |         at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
  |         at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
  |         at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
  |         at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
  |         at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
  |         at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
  |         at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
  |         at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
  |         at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:624)
  |         at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:442)
  |         at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:88)
  |         at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:46)
  |         at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
  |         at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
  |         at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:174)
  |         at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:970)
  |         at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:991)
  |         at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:911)
  |         at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
  |         at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
  |         at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
  |         at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
  |         at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
  |         at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:672)
  |         at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:455)
  |         at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:594)
  |         at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
  |         at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
  |         at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
  |         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
  |         at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
  |         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
  |         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
  |         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
  |         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
  |         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
  |         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
  |         at java.lang.Thread.run(Thread.java:619)
  | 11:28:46,877 WARN  [HDScanner] Failed to process changes
  | org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
  | 
  | *** CONTEXTS IN ERROR: Name -> Error
  | 
  | jboss.j2ee:ear=SimpleMDB.jar,jar=SimpleMDB.jar,name=SimpleMessageEJB,service=EJB3 -> org.jboss.deployment.DeploymentException: Required config property RequiredConfigPropertyMetaData at 1dc0d09[name=ConnectionFactoryName descriptions=[DescriptionMetaData at 87c7a8[language=en]]] for messagingType 'javax.jms.MessageListener' not found in activation config [ActivationConfigProperty(
  |             destinationType
  |                     =
  |             javax.jms.Queue
  |                     ), ActivationConfigProperty(
  |             Destination
  |                     =
  |             testqueue3
  |                     ), ActivationConfigProperty(
  |             Xa
  |                     =
  |             true
  |                     ), ActivationConfigProperty(
  |             Transacted
  |                     =
  |             true
  |                     ), ActivationConfigProperty(
  |             ConnectionFactoryName
  |                     =
  |             ConnectionFactory
  |                     ), ActivationConfigProperty(subscriptionDurability=false), ActivationConfigProperty(
  |             MaxPoolSize
  |                     =
  |             20
  |                     ), ActivationConfigProperty(
  |             DeliveryOption
  |                     =
  |             B
  |                     ), ActivationConfigProperty(
  |             MaxMessages
  |                     =
  |             1
  |                     ), ActivationConfigProperty(
  |             SubscriptionDurability
  |                     =
  |             Durable
  |                     )] ra=jboss.jca:service=RARDeployment,name='swiftmq.rar'
  | 
  | 
  |         at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:676)
  |         at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:661)
  |         at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:291)
  |         at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
  |         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
  |         at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
  |         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
  |         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
  |         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
  |         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
  |         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
  |         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
  |         at java.lang.Thread.run(Thread.java:619)
  | 

Please remarks that you have a scrict equivalency between the annoted code and the DD.
I also try to replace destination : testqueue3 with testqueue3 at router1
it does not work.

In fact, i feel that there is a bug in the process of converting the DD to activationConfig properties.

Should i open a bug ?

regards,
Olivier

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164692#4164692

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164692



More information about the jboss-user mailing list