简体   繁体   中英

How to correctly refactor ibm-ejb-jar-bnd.xmi file while doing app migration from WebSphere Application Server traditional to Liberty?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM