0

I'm using ejb 2.1 MDB. I've created the bean and the ibm-bnd-xmi file looks like this

<?xml version="1.0" encoding="UTF-8"?>
<ejbbnd:EJBJarBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ejb="ejb.xmi" xmlns:ejbbnd="ejbbnd.xmi" xmi:id="EJBJarBinding_1436860079989">
<ejbJar href="META-INF/ejb-jar.xml#ejb-jar_ID"/>
<ejbBindings xmi:type="ejbbnd:MessageDrivenBeanBinding" xmi:id="MessageDrivenBeanBinding_1436860521292">
<enterpriseBean xmi:type="ejb:MessageDriven" href="META-INF/ejb-jar.xml#TestMDB"/>
<resRefBindings xmi:id="ResourceRefBinding_1436860842233" jndiName="jms/qcf.QCF">
  <bindingResourceRef href="META-INF/ejb-jar.xml#ResourceRef_1436860842233"/>
</resRefBindings>
<resRefBindings xmi:id="ResourceRefBinding_1436861092345" jndiName="jms/ccqueue">
  <bindingResourceRef href="META-INF/ejb-jar.xml#ResourceRef_1436861092345"/>
</resRefBindings>
</ejbBindings>
</ejbbnd:EJBJarBinding>

When I deploy my MDB in websphere 8 i get the following exception

Caused by: com.ibm.ejs.jms.listener.MDBException: MDB TestMDB has no MessageDrivenBeanBinding in ibm-ejb-jar-bnd.xmi
at com.ibm.ejs.jms.listener.MDBListenerManagerImpl.create(MDBListenerManagerImpl.java:480)
at com.ibm.ejs.container.MDBHomeBean.activateEndpoint(MDBHomeBean.java:167)
... 74 more

I can see the configuration in the xmi file but it still spits out this error. Am I missing something?

Sujay DSa
  • 1,172
  • 2
  • 22
  • 37

1 Answers1

0

I am not able to see any <mesage-driven> entry in ejb-bnd.xml. Add an entry like this for your MDB

FOR EJB 3.1

<message-driven
        name="StatusUpdateMDB">
    <jca-adapter activation-spec-binding-name="jms/MC_StatusUpdateActivationSpec" destination-binding-name="jms/MobileClaimStatusQueue"/></message-driven>

For EJB 2.1

    <message-driven id="Mdb21">
  <ejb-name>Foo/ejb-name>
  <ejb-class>ejbs.FooBean</ejb-class>
   <messaging-type>javax.jms.MessageListener</messaging-type>
   <transaction-type>Bean/transaction-type>
   <message-destination-type>javax.jms.Topic</message-destination-type>
    <activation-config>
     <activation-config-property>
       <activation-config-property-name>destinationType</activation-config-property-name>
       <activation-config-property-value>javax.jms.Topic</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>acknowledgeMode</activation-config-property-name>
         <activation-config-property-value>AutoAcknowledge</activation-config-property-value>
      </activation-config-property>
      <activation-config-property>
        <activation-config-property-name>messageSelector</activation-config-property-name>
        <activation-config-property-value>fooSelector</activation-config-property-value>
      </activation-config-property>
</activation-config>
</message-driven>

For EJB 2.1 reference , see the IBM doc here.

AnkeyNigam
  • 2,810
  • 4
  • 15
  • 23
  • Is this allowed with ejb 2.1? I added this in the xmi file (not xml as xml is used only with ejb 3) and I got this: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'message-driven' not found. (file:///D:/IBM/RAD8/WebSphere/AppServer/profiles/CWBE_66/bin/META-INF/ibm-ejb-jar-bnd.xmi, 13, 31) – Sujay DSa Jul 20 '15 at 10:54
  • @lemonTea edited the code for EJB2.1. you need to do the changes in ` ejb-jar-2.1.xsd` – AnkeyNigam Jul 20 '15 at 12:11