由于 XSD,无法读取 application.xml

发布于 2025-01-04 13:41:48 字数 1753 浏览 2 评论 0原文

我正在使用 Maven 构建一个 Ear,在使用 java 1.6 制作它之后,我尝试在 Websphere 6.1 上部署。部署后,它会给出此警告,然后给出以下错误:

> +++ Warning +++: Sun Feb 12 10:17:03 AST 2012    org.xml.sax.SAXParseException: schema_reference.4:  Failed to read
> schema document 'http://java.sun.com/xml/ns/javaee/application_6.xsd',
> because 1) could not find the document; 2) the document could not be
> read; 3) the root element of the document is not <xsd:schema>.

错误:

> org.eclipse.jst.j2ee.commonarchivecore.internal.
> exception.DeploymentDescriptorLoadException: META-INF/application.xml
> Stack trace of nested exception:
> org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException:
> IWAE0007E Could not  load resource "META-INF/application.xml" in
> archive "D:\IBM\SDP70\runtimes\base_v61\profiles\AppSrv
> 01\wstemp\0\upload\finapp-ear-1.0-SNAPSHOT.ear" Stack trace of nested
> exception: Wrapped exception org.xml.sax.SAXParseException: cvc-elt.1:
> **Cannot find the declaration of element 'application'.**     at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)

我尝试在论坛和 Google 上搜索,但找不到任何具体内容。

我什至尝试将 application_6.xsd 放入 {WAS_HOME}/runtimes/base_61/properties/schemas/ 但无济于事。

application.xml 实际上是由 maven 制作的,所以我认为它应该不会有任何问题。它看起来是这样的:

<?xml version="1.0" encoding="UTF-8" ?> 
<application 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/application_6.xsd" version="6">

谁能告诉我这里出了什么问题吗?

I am using maven to build an ear and, after making it with java 1.6, I am trying to deploy on Websphere 6.1. Upon deployment it gives this warning and then the error below:

> +++ Warning +++: Sun Feb 12 10:17:03 AST 2012    org.xml.sax.SAXParseException: schema_reference.4:  Failed to read
> schema document 'http://java.sun.com/xml/ns/javaee/application_6.xsd',
> because 1) could not find the document; 2) the document could not be
> read; 3) the root element of the document is not <xsd:schema>.

error:

> org.eclipse.jst.j2ee.commonarchivecore.internal.
> exception.DeploymentDescriptorLoadException: META-INF/application.xml
> Stack trace of nested exception:
> org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException:
> IWAE0007E Could not  load resource "META-INF/application.xml" in
> archive "D:\IBM\SDP70\runtimes\base_v61\profiles\AppSrv
> 01\wstemp\0\upload\finapp-ear-1.0-SNAPSHOT.ear" Stack trace of nested
> exception: Wrapped exception org.xml.sax.SAXParseException: cvc-elt.1:
> **Cannot find the declaration of element 'application'.**     at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)

I tried searching on the forum and on Google but couldn't really find anything concrete on it.

I even tried to put the application_6.xsd in the {WAS_HOME}/runtimes/base_61/properties/schemas/ but to no avail.

The application.xml is actually made by maven so I don't think there should be any problem with it. This is what it looks like :

<?xml version="1.0" encoding="UTF-8" ?> 
<application 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/application_6.xsd" version="6">

Can anyone tell me whats wrong here?

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

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

发布评论

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

评论(1

伤痕我心 2025-01-11 13:41:48

DeploymentDescriptorLoadException 表示 application.xml 无效。生成的代码:

<?xml version="1.0" encoding="UTF-8" ?> 
<application 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/application_6.xsd" version="6">

不完整。使用 WebSphere Application Server Toolkit,如以下问题所示:

参考

The DeploymentDescriptorLoadException means that the application.xml is not valid. The generated code:

<?xml version="1.0" encoding="UTF-8" ?> 
<application 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/application_6.xsd" version="6">

is incomplete. Use the WebSphere Application Server Toolkit as in these questions:

References

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