【问题标题】:How to correctly refactor ibm-ejb-jar-bnd.xmi file while doing app migration from WebSphere Application Server traditional to Liberty?在将应用程序从 WebSphere Application Server 传统迁移到 Liberty 时,如何正确重构 ibm-ejb-jar-bnd.xmi 文件?
【发布时间】:2018-12-01 06:38:48
【问题描述】:

我在将应用程序从 WebSphere Application Server 传统 v9.0.0.7 迁移到 Liberty base 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 : namespace 语法。

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 文件? 请帮我解决问题。

【问题讨论】:

  • 如果您不了解此工具,我建议您使用 WebSphere 迁移工具包在从 websphere 传统迁移到 Liberty 期间标记此类问题。它会标记您在迁移过程中可能遇到的问题,并提供一些帮助/文档。这是扫描您的源代码并可以提供一些快速修复的工具(developer.ibm.com/wasdev/downloads/#asset/…),这是扫描二进制文件的二进制扫描程序(developer.ibm.com/wasdev/downloads/#asset/…)。

标签: jakarta-ee ejb websphere websphere-liberty open-liberty


【解决方案1】:

该消息有点令人困惑,因为两个版本的绑定文件都使用同一个解析器;旧的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 元素。

注意:ejb-jar.xml 3.0 或更高级别的文件支持较新的XML 格式,XMI 格式在所有先前级别的ejb-jar.xml 中都支持

【讨论】:

    猜你喜欢
    • 2020-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-21
    • 2015-12-19
    • 1970-01-01
    • 2011-11-25
    • 2020-07-25
    相关资源
    最近更新 更多