【发布时间】:2019-06-18 22:22:45
【问题描述】:
我有一个在 Eclipse 环境中运行的由 maven 构建的 Spring Web 应用程序,但我正在尝试将它部署到在 Ubuntu 服务器上运行的 tomcat。
当我尝试将它部署到它抛出的服务器时:
org.xml.sax.SAXParseException; systemId:
jar:file:/usr/share/tomcat8.5/webapplications/OpenElis2/WEB-INF/lib/spring-web-5.1.7.RELEASE.jar!/META-INF/web-fragment.xml;
lineNumber: 8; columnNumber: 18; schema_reference.4:
Failed to read schema document
'https://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd',
because
1) could not find the document;
2) the document could not be read;
3) the root element of the document is not <xsd:schema>.
我已确认我可以从服务器的该 url 下载正确的 xsd 文件,但错误仍然存在。我知道许多 spring xsd 文件都位于它们的 jar 中,但我无法在生成的 war 或 spring jar 中的任何位置找到这个文件。
相关软件版本:
- Tomcat 8.5
- Java 8
- 春天 5.1.7
有什么建议吗?
编辑**
xsd 文件 url 为 https 时似乎会发生故障,但在常规 http 时不会发生
【问题讨论】: