如何解决此 j2ee 架构中的重复属性错误?

发布于 2024-12-02 19:01:15 字数 1344 浏览 1 评论 0原文

我继承了一个为在 Weblogic 10 上部署而编写的 J2EE 应用程序,主要负责该应用程序的开发人员在 Eclipse 中打开该项目时不会收到此错误。

我有以下非常简单的 weblogic.xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/920/weblogic-web-app.xsd">   
    <container-descriptor>
        <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
</weblogic-web-app>

Eclipse 为该文件生成一个 XML 验证问题,该问题实际上包含许多相同的错误。 XML问题的父文本是这样的:

验证文件“j2ee_1_4.xsd”时检测到以下错误 通过文件“weblogic.xml”。在大多数情况下,这些错误可能是 通过直接验证“j2ee_1_4.xsd”来检测。然而它是 可能只有在验证 j2ee_1_4.xsd 时才会发生错误 weblogic.xml 的上下文。

以及子错误的示例。他们都是这样读的:

sch-props. Correct.2:一个模式不能包含两个同名的全局组件;此架构包含两次出现“http://java.sun.com/xml/ns/j2ee,descriptionGroup”。

后面跟着一个行号。这些错误大约有 50 个,只有错误末尾的引用名称发生变化。

我在 Sun 的错误跟踪器中发现了以下错误,这似乎表明了可能的原因,但我不确定如何将其应用到我的项目中,如果它相关的话。

无法从“web-app_2_4.xsd”创建 javax.xml.validation.Schema 实例< /a>

我不禁认为这与我的 Eclipse 配置有关,但此时我不知所措。

感谢您抽出时间。

I inherited a J2EE app written for deployment on Weblogic 10 and the developer primarily responsible for this application does not get this error when he opens the project in Eclipse.

I have the following very simple weblogic.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/920/weblogic-web-app.xsd">   
    <container-descriptor>
        <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
</weblogic-web-app>

Eclipse generates a single XML validation problem for this file, which actually consists of a number of the same errors. The parent text of the XML problem is this:

The errors below were detected when validating the file "j2ee_1_4.xsd"
via the file "weblogic.xml". In most cases these errors can be
detected by validating "j2ee_1_4.xsd" directly. However it is
possible that errors will only occur when j2ee_1_4.xsd is validated in
the context of weblogic.xml.

And an example of the child errors. They all read this way:

sch-props.correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of 'http://java.sun.com/xml/ns/j2ee,descriptionGroup'.

This is followed by a line number. There are about 50 of these errors, and only the quoted name at the end of the error changes.

I found the following bug in Sun's bug tracker which seemed to indicate a possible cause, but I'm not sure how I'd apply it to my project, if it's even relevant.

Impossible to create javax.xml.validation.Schema instance from "web-app_2_4.xsd"

I can't help but think that this is related to my Eclipse configuration, but at this point I'm at a loss.

Thanks for your time.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小ぇ时光︴ 2024-12-09 19:01:15

我遇到了同样的问题。我在网上找到了一篇关于需要更新到最新架构的文章,因此我在此处查看了 Oracle 的最新架构版本: http://www.oracle.com/webfolder/technetwork/weblogic/weblogic-web-app/index.html

我使用以下内容修改了 weblogic.xml 文件:

<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd">

...
</weblogic-web-app>

问候,
何塞

I ran into the same issue. I found an article online about needing to update to the latest schema so I looked through Oracle for latest schemas versions here: http://www.oracle.com/webfolder/technetwork/weblogic/weblogic-web-app/index.html

I modified my weblogic.xml file with the following:

<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd">

...
</weblogic-web-app>

Regards,
Jose

紫竹語嫣☆ 2024-12-09 19:01:15

您说这是为 WL 10 编写的。

我的 weblogic.xml 开头为

<weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app

http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web -app.xsd"

xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">

虽然我可以看到你的指向 Weblogic 9 命名空间,

xmlns="http://www.bea.com/ns/weblogic/90"

但更改此名称是否会有所不同?

You say this is written for WL 10.

My weblogic.xml begins as

<weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app

http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd"

xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">

while I can see yours points to the Weblogic 9 namespace

xmlns="http://www.bea.com/ns/weblogic/90"

Does changing this make a difference?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文