繁体   English   中英

在将应用程序从传统的WebSphere Application Server迁移到Liberty时,如何正确重构ibm-ejb-jar-bnd.xmi文件?

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

从WebSphere Application Server传统v9.0.0.7迁移到Liberty基本v18.0.0.1的应用程序迁移时遇到错误

控制台中的一个例外说明:

...
    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.
...

EJB绑定似乎有问题。 我一直在阅读Liberty不支持WAS 9 EJB绑定,而仅将EJB绑定到java:名称空间语法。

ibm-ejb-jar-bnd.xmi文件如下所示:

<?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>

我应该如何精确重构ibm-ejb-jar-bnd.xmi文件? 请帮助我解决问题。

该消息有些混乱,因为绑定文件的两个版本都使用相同的解析器。 旧的ibm-ejb-jar-bnd.xmi和新的ibm-ejb-jar-bnd.xml 以较新的格式(XML)定义的name属性是较旧的格式(XMI)的计算值,并通过处理以下行来确定:

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

具体来说,解析器将遵循href并查找相应EJB的ejb-name元素。 您应该在ejb-jar.xml查找相应的条目,如下所示:

<session id="UtilitySession">

要么丢失,要么可能多次出现。 或者,它缺少ejb-name元素。

注:较新的XML格式支持的ejb-jar.xml的文件在3.0级或更高版本和XMI格式在以前的所有级别支持ejb-jar.xml

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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