Intelij 项目中连接到服务器 GlassFish 出错的原因是什么?

[2019-10-12T11:06:32.875+0300] [glassfish 5.0] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=45 _ThreadName=admin-listener(4)] [timeMillis: 1570867592875] [levelValue: 1000] [[

  Exception while deploying the app [web_war_exploded]]]


[2019-10-12T11:06:32.876+0300] [glassfish 5.0] [SEVERE] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=45 _ThreadName=admin-listener(4)] [timeMillis: 1570867592876] [levelValue: 1000] [[

  Exception during lifecycle processing

java.io.IOException: org.xml.sax.SAXParseExceptionpublicId: file:/home/vladimir/Downloads/glassfish-5.0/glassfish5/glassfish/lib/schemas/web-app_4_0.xsd; lineNumber: 8; columnNumber: 27; Deployment descriptor file WEB-INF/web.xml in archive [web_war_exploded].  TargetNamespace.1: Expecting namespace 'http://java.sun.com/xml/ns/javaee', but the target namespace of the schema document is 'http://xmlns.jcp.org/xml/ns/javaee'.

    at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:215)

    at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:231)

    at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:97)

    at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:881)

    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)

    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)

    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)

]]


MMMHUHU
浏览 103回答 1
1回答

互换的青春

堆栈跟踪之前的长错误消息(为了清晰起见重新格式化)解释了该问题:java.io.IOException: org.xml.sax.SAXParseExceptionpublicId: file:/home/vladimir/Downloads/glassfish-5.0/glassfish5/glassfish/lib/schemas/web-app_4_0.xsd;lineNumber: 8; columnNumber: 27; Deployment descriptor file  in archive [web_war_exploded].  TargetNamespace.1: Expecting namespace'http://java.sun.com/xml/ns/javaee', but the target namespace of the schema document is 'http://xmlns.jcp.org/xml/ns/javaee'.因此,Glassfish 架构定义 ( web-app_4_0.xsd ) 中指定的命名空间与您在应用程序的部署描述符 ( WEB-INF/web.xml ) 中提供的命名空间不匹配。这是 Glassfish 的web-app_4_0.xsd的顶级内容:<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"            targetNamespace="http://xmlns.jcp.org/xml/ns/javaee"            xmlns:javaee="http://xmlns.jcp.org/xml/ns/javaee"            xmlns:xsd="http://www.w3.org/2001/XMLSchema"            elementFormDefault="qualified"            attributeFormDefault="unqualified"            version="4.0">...</xsd:schema>targetNamespace请注意,为和指定的值xmlns:javaee是您应该在应用程序的web.xml"http://xmlns.jcp.org/xml/ns/javaee"中指定的值,而不是。修理:"http://java.sun.com/xml/ns/javaee"停止玻璃鱼在应用程序的web.xml中,将所有出现的 替换http://java.sun.com/xml/ns/javaee为http://xmlns.jcp.org/xml/ns/javaee。清理、构建和重新部署您的应用程序。重新启动 Glassfish 服务器。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java