无法启动网络关闭的启动项目

问题描述 投票:1回答:1

我已经创建了Spring启动应用程序。这很简单:

插件:

apply plugin: 'war'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

在我的构建脚本中:

buildscript {
    dependencies {
            classpath("org.springframework.boot:spring-boot-gradle-plugin:2.1.3.RELEASE")
    }
}

和依赖:

compile("org.springframework.boot:spring-boot-devtools")
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-security")
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'

另外我有依赖关系:lambok,h2,webjars等。没有什么有趣的。

所以在我的本地机器上:

  • 在我的本地机器上我构建war文件!
  • 一切都好!没问题!

我没有任何问题!但是当我在“那里没有网络”的服务器上部署它时

Mar 27, 2019 11:44:59 AM org.apache.tomcat.util.digester.Digester warning
WARNING: Parse Warning Error at line 25 column 19: schema_reference.4: Failed to read schema document 'http://xmlns.jcp.org/xml/ns/javaee/web-fragment_4_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>.
org.xml.sax.SAXParseException; systemId: jar:jar:file:/.../war.war!/WEB-INF/lib/tomcat-embed-websocket-9.0.14.jar!/META-INF/web-fragment.xml; lineNumber: 25; columnNumber: 19; schema_reference.4: Failed to read schema document 'http://xmlns.jcp.org/xml/ns/javaee/web-fragment_4_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>.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)

不知道怎样才能解决问题?

只是简单的Web应用程序,没有任何XML配置

spring spring-boot spring-mvc tomcat tomcat9
1个回答
1
投票

您可以将xsd放在服务器上的类路径中,而无需网络连接。只有在找不到xsd的本地类路径副本时才使用XSD URL。

还有details on registering schemas,但这可能是矫枉过正。

© www.soinside.com 2019 - 2024. All rights reserved.