簡體   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