During the deployment of our migrated ear with 2 war's from old Websphere 8.x into OpenLiberty I get this issue regarding unexpected element in the xmi:
[ERROR ] CWWKZ0002E: An exception occurred while starting the application NAMEOFEAR-1.0.0. The exception message was: com.ibm.ws.container.service.metadata.MetaDataException: com.ibm.wsspi.adaptable.module.UnableToAdaptException: com.ibm.ejs.container.EJBConfigurationException: com.ibm.wsspi.adaptable.module.UnableToAdaptException: com.ibm.ws.javaee.ddmodel.DDParser$ParseException: CWWKC2256E: Unexpected attribute listenerInputPortName encountered parsing element ejbBindings in the NAMEOFEAR-1.0.0.ear : NAMEOFJAR-1.0.0.jar : META-INF/ibm-ejb-jar-bnd.xmi deployment descriptor on line 4.
Simply removing the listenerInputPortName attribute worked, but I'm sure it will lead to problems afterwards?
The ibm-ejb-jar-bnd.xmi 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_1">
<ejbJar href="META-INF/ejb-jar.xml#ejb-jar_ID"/>
<ejbBindings xmi:type="ejbbnd:MessageDrivenBeanBinding" xmi:id="MessageDrivenBeanBinding_1" listenerInputPortName="SMTPMessageListenerPort">
<enterpriseBean xmi:type="ejb:MessageDriven" href="META-INF/ejb-jar.xml#MessageDriven_1"/>
<resRefBindings xmi:id="ResourceRefBinding_1" jndiName="mail/SMTPMailSession">
</ejbBindings>
</ejbbnd:EJBJarBinding>
Also example ejb-jar.xml:
<ejb-jar ...>
<display-name>ejb</display-name>
<enterprise-beans>
<message-driven id="MessageDriven_1">
<ejb-name>SMTPSender</ejb-name>
<ejb-class>com.smtp.SMTPSendBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-destination-type>javax.jms.Queue</message-destination-type>
<activation-config>
...
</activation-config>
<resource-ref id="ResourceRef_1">
...
</resource-ref>
</message-driven>
</enterprise-beans>
</ejb-jar>
JMS-resources.xml (I'm using config-drop ins):
<?xml version="1.0" encoding="UTF-8"?>
<server>
...
<jmsQueueConnectionFactory jndiName="jms/CompanySMTPMessageConnectionFactory">
<properties.mqJMS
...
transportType="CLIENT"/>
</jmsQueueConnectionFactory>
<jmsQueue jndiName="jms/SMTPMessageQueue">
<properties.mqJMS baseQueueName="Q2"/>
</jmsQueue>
</server>
I'm not sure how to migrate it to work with EJB 3.1 and running/deploying in OpenLiberty.
There are no
listener ports in OpenLiberty. MDBs are usingActiveSpecifications. You have to do update bindings to use AS or do it inserver.xml. Check docs for using mdbs in OpenLiberty (depending on jms provider you are using) - https://www.ibm.com/docs/en/was-liberty/base?topic=liberty-deploying-message-driven-beans-withinUpdate based on your additional info:
Looking at the resources defined, it seems that you are using WebSphere MQ and want your MDB to connect to the queue (although you didnt provide their names - you will have to check ListenerPorts configurations).
Here are a few changes you need:
<feature>jmsMdb-3.2</feature>If your QM requires authentication you need to add these additional props:
idin the activeSpec must follow the following naming convention "application name/module name/bean name" in your case it shoiuld be for exampeid=NAMEOFEAR-1.0.0/ejb/CompanyEventLogYou should be able to define this binding also via
xmibinding file, but I dont have example at hand since its very old. You would need IBM Rational Application Developer, which should still have editor for xmi files.In
xmlformat it would look like this:So maybe try first the binding in
server.xml.