1 Reply Latest reply on Nov 28, 2005 9:57 PM by Adrian Brock

    Problems registering a resource adaper for MDB / EJB3

    cleonhar Newbie

      Hi,

      i try to use SwiftMQ with JBoss 4.0.3SP1. I am using EJB3. To register the resource adapter I tried the following files:

      ejb-jar.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
       http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
       version="2.1">
      
       <enterprise-beans>
      
       <message-driven>
       <ejb-name>StatisticMessageReveiverService</ejb-name>
       <ejb-class>de.mobileview.mmstat.services.StatisticMessageReveiverService</ejb-class>
       <messaging-type>javax.jms.MessageListener</messaging-type>
       <transaction-type>Container</transaction-type>
       <activation-config>
       <activation-config-property>
       <activation-config-property-name>Destination</activation-config-property-name>
       <activation-config-property-value>testqueue</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>props</activation-config-property-name>
       <activation-config-property-value>
       key1=value1
       key2=value2
       key3=value3
       </activation-config-property-value>
       </activation-config-property>
       </activation-config>
       </message-driven>
      
       </enterprise-beans>
      
       <assembly-descriptor>
      
       <container-transaction>
       <method>
       <ejb-name>StatisticMessageReveiverService</ejb-name>
       <method-name>*</method-name>
       </method>
       <trans-attribute>Required</trans-attribute>
       </container-transaction>
       </assembly-descriptor>
      
      </ejb-jar>
      
      


      jboss.xml:

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


      [There was a similar example in the CVS of JBOSS.]


      But during startup of JBOSS I get the following error message:

      2005-11-28 12:18:02,079 DEBUG [org.jboss.ejb3.Ejb3Module] Initialization failed jboss.j2ee:service=EJB3,module=mmcore.ejb3
      org.jboss.xb.binding.JBossXBException: Failed to parse source.
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:138)
       at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:173)
       at org.jboss.ejb3.Ejb3DescriptorHandler.parseDescriptors(Ejb3DescriptorHandler.java:443)
       at org.jboss.ejb3.Ejb3HandlerFactory$DDFactory.<init>(Ejb3HandlerFactory.java:25)
       at org.jboss.ejb3.Ejb3HandlerFactory.getInstance(Ejb3HandlerFactory.java:58)
       at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:263)
       at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:251)
       at org.jboss.ejb3.Ejb3JmxDeployment.create(Ejb3JmxDeployment.java:230)
       at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:34)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:245)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:228)
       at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
       at $Proxy0.create(Unknown Source)
       at org.jboss.system.ServiceController.create(ServiceController.java:341)
       at org.jboss.system.ServiceController.create(ServiceController.java:284)
       at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy10.create(Unknown Source)
       at org.jboss.ejb3.EJB3Deployer.create(EJB3Deployer.java:208)
       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:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy11.create(Unknown Source)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:935)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:925)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:789)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
       at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy6.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:265)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
       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:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:428)
       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:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:285)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)
       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:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:453)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:330)
       at org.jboss.Main.boot(Main.java:187)
       at org.jboss.Main$1.run(Main.java:438)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.xml.sax.SAXException: Element type "message-driven" must be declared. @ *unknown*[6,23]
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$MetaDataErrorHandler.error(SaxJBossXBParser.java:232)
       at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
       at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
       at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
       at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
       at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
       at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
       at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:134)
       ... 114 more
      
      


      Or shorter:

      Caused by: org.xml.sax.SAXException: Element type "message-driven" must be declared. @ *unknown*[6,23]
      


      Somehow JBoss can not handle the message-driven-Tag.

      Did I do something completely wrong? Or is there any problem with Jboss?

      Bye
      Claus