有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

尝试在weblogic 12c上部署war时发现java验证问题错误

我正试图在weblogic 12c上部署maven项目。项目在Spring4(Java1.8)中配置。下面是我的网络逻辑。xml

<?xml version="1.0" encoding="UTF-8"?>

<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.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
<jsp-descriptor>
<keepgenerated>true</keepgenerated>
<debug>true</debug>
</jsp-descriptor>
<context-root>/FileCompare</context-root>
<fast-swap>
<enabled>false</enabled>
</fast-swap>
</weblogic-web-app>

下面是我的网站。xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">
  <display-name>FileCompare</display-name>
  <welcome-file-list>
    <welcome-file>login.jsp</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
</web-app>

这两个文件的位置在WEB-INF下。我成功地将其部署在apache tomcat8上。但在weblogic 12c上部署war时,出现了以下错误

Message icon - Error Unable to access the selected application.
Message icon - Error VALIDATION PROBLEMS WERE FOUND <3:5> problem: cvc-complex-type.2.4a: Expected elements 'module-name@http://java.sun.com/xml/ns/javaee description@http://java.sun.com/xml/ns/javaee display-name@http://java.sun.com/xml/ns/javaee icon@http://java.sun.com/xml/ns/javaee distributable@http://java.sun.com/xml/ns/javaee context-param@http://java.sun.com/xml/ns/javaee filter@http://java.sun.com/xml/ns/javaee filter-mapping@http://java.sun.com/xml/ns/javaee listener@http://java.sun.com/xml/ns/javaee servlet@http://java.sun.com/xml/ns/javaee servlet-mapping@http://java.sun.com/xml/ns/javaee session-config@http://java.sun.com/xml/ns/javaee mime-mapping@http://java.sun.com/xml/ns/javaee welcome-file-list@http://java.sun.com/xml/ns/javaee problem-page@http://java.sun.com/xml/ns/javaee jsp-config@http://java.sun.com/xml/ns/javaee security-constraint@http://java.sun.com/xml/ns/javaee login-config@http://java.sun.com/xml/ns/javaee security-role@http://java.sun.com/xml/ns/javaee env-entry@http://java.sun.com/xml/ns/javaee ejb-ref@http://java.sun.com/xml/ns/javaee ejb-local-ref@http://java.sun.com/xml/ns/javaee service-ref@http://java.sun.com/xml/ns/javaee resource-ref@http://java.sun.com/xml/ns/javaee resource-env-ref@http://java.sun.com/xml/ns/javaee message-destination-ref@http://java.sun.com/xml/ns/javaee persistence-context-ref@http://java.sun.com/xml/ns/javaee persistence-unit-ref@http://java.sun.com/xml/ns/javaee post-construct@http://java.sun.com/xml/ns/javaee pre-destroy@http://java.sun.com/xml/ns/javaee data-source@http://java.sun.com/xml/ns/javaee message-destination@http://java.sun.com/xml/ns/javaee locale-encoding-mapping-list@http://java.sun.com/xml/ns/javaee absolute-ordering@http://java.sun.com/xml/ns/javaee' instead of 'display-name@http://xmlns.jcp.org/xml/ns/javaee' here in element web-app@http://java.sun.com/xml/ns/javaee <5:7> problem: cvc-complex-type.2.4a: Expected element 'welcome-file@http://java.sun.com/xml/ns/javaee' instead of 'welcome-file@http://xmlns.jcp.org/xml/ns/javaee' here in element welcome-file-list@http://java.sun.com/xml/ns/javaee <6:7> problem: cvc-complex-type.2.4a: Expected element 'welcome-file@http://java.sun.com/xml/ns/javaee' instead of 'welcome-file@http://xmlns.jcp.org/xml/ns/javaee' here in element welcome-file-list@http://java.sun.com/xml/ns/javaee <7:7> problem: cvc-complex-type.2.4a: Expected element 'welcome-file@http://java.sun.com/xml/ns/javaee' instead of 'welcome-file@http://xmlns.jcp.org/xml/ns/javaee' here in element welcome-file-list@http://java.sun.com/xml/ns/javaee <8:7> problem: cvc-complex-type.2.4a: Expected element 'welcome-file@http://java.sun.com/xml/ns/javaee' instead of 'welcome-file@http://xmlns.jcp.org/xml/ns/javaee' here in element welcome-file-list@http://java.sun.com/xml/ns/javaee <9:7> problem: cvc-complex-type.2.4a: Expected element 'welcome-file@http://java.sun.com/xml/ns/javaee' instead of 'welcome-file@http://xmlns.jcp.org/xml/ns/javaee' here in element welcome-file-list@http://java.sun.com/xml/ns/javaee <10:7> problem: cvc-complex-type.2.4a: Expected element 'welcome-file@http://java.sun.com/xml/ns/javaee' instead of 'welcome-file@http://xmlns.jcp.org/xml/ns/javaee' here in element welcome-file-list@http://java.sun.com/xml/ns/javaee <4:5> problem: cvc-complex-type.2.4c: Expected element 'welcome-file@http://java.sun.com/xml/ns/javaee' before the end of the content in element welcome-file-list@http://java.sun.com/xml/ns/javaee
Message icon - Error VALIDATION PROBLEMS WERE FOUND <3:5> problem: cvc-complex-type.2.4a: Expected elements 'module-name@http://java.sun.com/xml/ns/javaee description@http://java.sun.com/xml/ns/javaee display-name@http://java.sun.com/xml/ns/javaee icon@http://java.sun.com/xml/ns/javaee distributable@http://java.sun.com/xml/ns/javaee context-param@http://java.sun.com/xml/ns/javaee filter@http://java.sun.com/xml/ns/javaee filter-mapping@http://java.sun.com/xml/ns/javaee listener@http://java.sun.com/xml/ns/javaee servlet@http://java.sun.com/xml/ns/javaee servlet-mapping@http://java.sun.com/xml/ns/javaee session-config@http://java.sun.com/xml/ns/javaee mime-mapping@http://java.sun.com/xml/ns/javaee welcome-file-list@http://java.sun.com/xml/ns/javaee problem-page@http://java.sun.com/xml/ns/javaee jsp-config@http://java.sun.com/xml/ns/javaee security-constraint@http://java.sun.com/xml/ns/javaee login-config@http://java.sun.com/xml/ns/javaee security-role@http://java.sun.com/xml/ns/javaee env-entry@http://java.sun.com/xml/ns/javaee ejb-ref@http://java.sun.com/xml/ns/javaee ejb-local-ref@http://java.sun.com/xml/ns/javaee service-ref@http://java.sun.com/xml/ns/javaee resource-ref@http://java.sun.com/xml/ns/javaee resource-env-ref@http://java.sun.com/xml/ns/javaee message-destination-ref@http://java.sun.com/xml/ns/javaee persistence-context-ref@http://java.sun.com/xml/ns/javaee persistence-unit-ref@http://java.sun.com/xml/ns/javaee post-construct@http://java.sun.com/xml/ns/javaee pre-destroy@http://java.sun.com/xml/ns/javaee data-source@http://java.sun.com/xml/ns/javaee message-destination@http://java.sun.com/xml/ns/javaee locale-encoding-mapping-list@http://java.sun.com/xml/ns/javaee absolute-ordering@http://java.sun.com/xml/ns/javaee' instead of 'display-name@http://xmlns.jcp.org/xml/ns/javaee' here in element web-app@http://java.sun.com/xml/ns/javaee <5:7> problem: cvc-complex-type.2.4a: Expected element 'welcome-file@http://java.sun.com/xml/ns/javaee' instead of 'welcome-file@http://xmlns.jcp.org/xml/ns/javaee' here in element welcome-file-list@http://java.sun.com/xml/ns/javaee <6:7> problem: cvc-complex-type.2.4a: Expected element 'welcome-file@http://java.sun.com/xml/ns/javaee' instead of 'welcome-file@http://xmlns.jcp.org/xml/ns/javaee' here in element welcome-file-list@http://java.sun.com/xml/ns/javaee <7:7> problem: cvc-complex-type.2.4a: Expected element 'welcome-file@http://java.sun.com/xml/ns/javaee' instead of 'welcome-file@http://xmlns.jcp.org/xml/ns/javaee' here in element welcome-file-list@http://java.sun.com/xml/ns/javaee <8:7> problem: cvc-complex-type.2.4a: Expected element 'welcome-file@http://java.sun.com/xml/ns/javaee' instead of 'welcome-file@http://xmlns.jcp.org/xml/ns/javaee' here in element welcome-file-list@http://java.sun.com/xml/ns/javaee <9:7> problem: cvc-complex-type.2.4a: Expected element 'welcome-file@http://java.sun.com/xml/ns/javaee' instead of 'welcome-file@http://xmlns.jcp.org/xml/ns/javaee' here in element welcome-file-list@http://java.sun.com/xml/ns/javaee <10:7> problem: cvc-complex-type.2.4a: Expected element 'welcome-file@http://java.sun.com/xml/ns/javaee' instead of 'welcome-file@http://xmlns.jcp.org/xml/ns/javaee' here in element welcome-file-list@http://java.sun.com/xml/ns/javaee <4:5> problem: cvc-complex-type.2.4c: Expected element 'welcome-file@http://java.sun.com/xml/ns/javaee' before the end of the content in element welcome-file-list@http://java.sun.com/xml/ns/javaee

共 (1) 个答案

  1. # 1 楼答案

    <web-app>具有错误的xml命名空间。尝试使用xmlns="http://java.sun.com/xml/ns/javaee"