1 回答

TA貢獻1797條經驗 獲得超6個贊
堆棧跟蹤之前的長錯誤消息(為了清晰起見重新格式化)解釋了該問題:
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 架構定義 ( 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 服務器。
添加回答
舉報