java 错误:包含版本 <unknown> 部署描述符的项目需要 XMI 格式的绑定或扩展文件。ibm-web-bnd.xml

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10243424/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 00:11:32  来源:igfitidea点击:

Error: Projects containing version <unknown> deployment descriptors require XMI-format bindings or extensions files. ibm-web-bnd.xml

javajakarta-eewebsphereibm-rad

提问by mmm

I have upgraded editor from Rad 7.5 to 8and maven 2 to 3. This happens just after importing existing maven projectsin RAD 8, but I have no errors on any pom files.

我已将编辑器从Rad 7.5升级到 8并将maven 2升级到 3。这是在 RAD 8 中导入现有的 maven 项目之后发生的,但我对任何 pom 文件都没有错误。

The issue is with two xml files :

问题在于两个 xml 文件:

Projects containing version deployment descriptors require XMI-format bindings or extensions files. ibm-web-bnd.xml/DocViewerWeb/WebContent/WEB-INF Unknown Validation Message

包含版本部署描述符的项目需要 XMI 格式的绑定或扩展文件。ibm-web-bnd.xml/DocViewerWeb/WebContent/WEB-INF 未知验证消息

Projects containing version deployment descriptors require XMI-format bindings or extensions files. ibm-web-ext.xml/DocViewerWeb/WebContent/WEB-INF Unknown Validation Message

包含版本部署描述符的项目需要 XMI 格式的绑定或扩展文件。ibm-web-ext.xml/DocViewerWeb/WebContent/WEB-INF 未知验证消息

Contents of those two files are:

这两个文件的内容是:

<?xml version="1.0" encoding="UTF-8"?>
<web-bnd 
    xmlns="http://websphere.ibm.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-bnd_1_0.xsd"
    version="1.0">

    <virtual-host name="default_host" />

  <ejb-ref name="ejb/MaintenanceServices" binding-name="ejblocal:com.tscdv.document.b.MaintenanceServices" />
  <ejb-ref name="ejb/ServiceTipsDocumentServices" binding-name="ejblocal:com.tscdv.document.b.ServiceTipsDocumentServices" />
  <ejb-ref name="ejb/ActivityDocumentServices" binding-name="ejblocal:com.tscdv.document.b.ActivityDocumentServices" />
  <ejb-ref name="ejb/BulletinDocumentServices" binding-name="ejblocal:com.tscdv.document.b.BulletinDocumentServices" />
  <ejb-ref name="ejb/CommonService" binding-name="ejblocal:com.tscdv.document.b.CommonService" />
  <ejb-ref name="ejb/AdminServices" binding-name="ejblocal:com.tscdv.document.b.AdminServices" />

</web-bnd>

and

<?xml version="1.0" encoding="UTF-8"?>
<web-ext
    xmlns="http://websphere.ibm.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-ext_1_0.xsd"
    version="1.0">

    <reload-interval value="3"/>
    <context-root uri="DocViewerWeb" />
    <enable-directory-browsing value="true"/>
    <enable-file-serving value="true"/>
    <enable-reloading value="true"/>
    <enable-serving-servlets-by-class-name value="true" />

</web-ext>

What could be the problem here?

这里可能有什么问题?

I have posted another possibly related issue: JSR250: CommonAnnotations for Java, 2.3: @Resource methods must be setters that follow the standard JavaBeans convention

我发布了另一个可能相关的问题JSR250: CommonAnnotations for Java, 2.3: @Resource 方法必须是遵循标准 JavaBeans 约定的 setter

回答by Brett Kail

Projects containing web.xml with version="2.4"or lower require ibm-web-bnd.xmiand ibm-web-ext.xmi.

包含带有version="2.4"或更低版本的web.xml 的项目需要 ibm-web-bnd。xmi和 ibm-web-ext。xmi.

Projects containing web.xml with version="2.5"or higher require ibm-web-bnd.xmland ibm-web-ext.xml.

包含带有version="2.5"或更高版本的web.xml 的项目需要 ibm-web-bnd。xml和 ibm-web-ext。XML

Perhaps the change in tool versions has upgraded your web.xml version to 2.5, and now RAD is warning that this is incompatible with your web.xml?

也许工具版本的变化已经将您的 web.xml 版本升级到 2.5,现在 RAD 警告说这与您的 web.xml 不兼容?

回答by Russ

In extension to the comment on bkail's answer (which is helpful) if you want to use web.xml version 2.5 you should use the following prolog and parent node. Technically the comment is inaccurate as the namespaces are missing http:// and will cause additional errors if you do not use this:

如果您想使用 web.xml 2.5 版,那么对 bkail 的答案(这很有帮助)的评论的扩展,您应该使用以下序言和父节点。从技术上讲,该注释是不准确的,因为命名空间缺少 http:// 并且如果您不使用它会导致其他错误:

<?xml version="1.0" encoding="UTF-8"?>
<web-app
  xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  version="2.5">