1 回答

TA貢獻(xiàn)1797條經(jīng)驗(yàn) 獲得超6個(gè)贊
堆棧跟蹤之前的長錯(cuò)誤消息(為了清晰起見重新格式化)解釋了該問題:
java.io.IOException: org.xml.sax.SAXParseException
publicId:?
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 架構(gòu)定義 ( web-app_4_0.xsd ) 中指定的命名空間與您在應(yīng)用程序的部署描述符 ( WEB-INF/web.xml ) 中提供的命名空間不匹配。
這是 Glassfish 的web-app_4_0.xsd的頂級內(nèi)容:
<?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
是您應(yīng)該在應(yīng)用程序的web.xml"http://xmlns.jcp.org/xml/ns/javaee"
中指定的值,而不是。修理:"http://java.sun.com/xml/ns/javaee"
停止玻璃魚
在應(yīng)用程序的web.xml中,將所有出現(xiàn)的 替換
http://java.sun.com/xml/ns/javaee
為http://xmlns.jcp.org/xml/ns/javaee
。清理、構(gòu)建和重新部署您的應(yīng)用程序。
重新啟動(dòng) Glassfish 服務(wù)器。
添加回答
舉報(bào)