Glassfish 5.0战争部署错误

时间:2018-08-27 22:29:05

标签: intellij-idea web-applications glassfish

我正在尝试创建我的应用程序的WAR并将其部署。

尝试部署时,出现以下错误消息:

Error occurred during deployment: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 15; Deployment descriptor file META-INF/application.xml in archive [usabilityExperiments_war]. cvc-complex-type.2.4.b: The content of element 'application' is not complete. One of '{"http://java.sun.com/xml/ns/javaee":application-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":initialize-in-order, "http://java.sun.com/xml/ns/javaee":module}' is expected.. Please see server.log for more details.

错误指向第6行上的application.xml文件。 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">
</application>

以下是我的web.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         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"
         version="3.1">
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>usability_war_exploded</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

</web-app>

我曾经能够创建WAR并部署它,但是由于某种原因,我无法确定它不再起作用。

application.xml文件中似乎需要一些东西,但我不知道是什么。 有人可以帮助我了解发生了什么以及如何解决我的问题吗?

谢谢

0 个答案:

没有答案