我正在使用maven构建一个ear,在使用java1.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)我试着在论坛和谷歌上搜索,但没有找到任何具体的东西。
我甚至尝试将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">有人能告诉我这里出了什么问题吗?
发布于 2014-09-16 01:53:21
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应用程序服务器工具包:
参考
https://stackoverflow.com/questions/9247312
复制相似问题