0
votes

I am facing an error while doing app migration from WebSphere Application Server traditional v9.0.0.7 to Liberty base v18.0.0.1

An exceptions in console says:

...
    CWWKZ0002E: An exception occurred while starting the application AP. 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: 
    CWWKC2251E: The ejbBindings element is missing the required name attribute in the /META-INF/ibm-ejb-jar-bnd.xmi deployment descriptor on line 9.
...

It seems like there is an issue with EJB binding. I have been reading that Liberty doesn't support WAS 9 EJBs binding and only binds EJBs to the java : namespace syntax.

ibm-ejb-jar-bnd.xmi file looks like:

<?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_1090575365340">
  <ejbJar href="META-INF/ejb-jar.xml#ejb-jar_ID"/>
  <ejbBindings xmi:id="EnterpriseBeanBinding_1090575365340" jndiName="ejb/com/ap/ejb/AccountSessionHome">
    <enterpriseBean xmi:type="ejb:Session" href="META-INF/ejb-jar.xml#AccountSession"/>
  </ejbBindings>
  <ejbBindings xmi:id="EnterpriseBeanBinding_1047783791228" jndiName="ejb/com/ap/ejb/UtilitySessionHome">
    <enterpriseBean xmi:type="ejb:Session" href="META-INF/ejb-jar.xml#UtilitySession"/>
  </ejbBindings>
</ejbbnd:EJBJarBinding>

How exactly should I refactor the ibm-ejb-jar-bnd.xmi file? Please help me to sort out the issue.

1
In case you aren't aware of this tool, I would recommend using the WebSphere migration toolkit to flag these kind of issues during your migration from websphere traditional to Liberty. It flags issues you might run into during your migration and provides some help/doc. Here is the tool that scans your source and can provide some quick fixes (developer.ibm.com/wasdev/downloads/#asset/…) and here is the binary scanner that scans binaries (developer.ibm.com/wasdev/downloads/#asset/…).dalia

1 Answers

2
votes

The message is a little confusing because the same parser is used for both versions of the binding file; the old one, ibm-ejb-jar-bnd.xmi, and the new one, ibm-ejb-jar-bnd.xml. The name attribute as defined in the newer format (XML) is a calculated value in the older format (XMI), and is determined by processing this line:

<enterpriseBean xmi:type="ejb:Session" href="META-INF/ejb-jar.xml#UtilitySession"/>

Specifically, the parser will follow the href and look for the ejb-name element of the corresponding EJB. You should look in your ejb-jar.xml for a corresponding entry like this:

<session id="UtilitySession">

Either that is missing, or possibly there are multiple occurrences. Or, it is missing an ejb-name element.

Note: the newer XML format is supported in ejb-jar.xml files at level 3.0 or newer and the XMI format is supported in all prior levels of ejb-jar.xml