亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Intelij 項目中連接到服務器 GlassFish 出錯的原因是什么?

Intelij 項目中連接到服務器 GlassFish 出錯的原因是什么?

MMMHUHU 2023-10-13 16:34:37
[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 processingjava.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)]]
查看完整描述

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/javaeehttp://xmlns.jcp.org/xml/ns/javaee

  • 清理、構建和重新部署您的應用程序。

  • 重新啟動 Glassfish 服務器。

查看完整回答
反對 回復 2023-10-13
  • 1 回答
  • 0 關注
  • 135 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號