Issue
I've created Spring boot application. It's simple:
plugins:
apply plugin: 'war'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
And in my build script:
buildscript {
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.1.3.RELEASE")
}
}
and dependencies:
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'
Additionally I have dependencies like: lambok, h2, webjars etc. Nothing interesting.
So in my local machine:
- In my local machine I build war file!
- Everything is fine! no problem at all!
I have no problems at all! BUT when I deploy it at the server where "THERE IS NO NETWORK"
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)
Any idea how can I solve the problem?
Just simple web application without any XML configurations.
Solution
You can put the xsd in your classpath on the server without network connectivity. The XSD url is only used when a local classpath copy of the xsd is not found.
There are also details on registering schemas, but this is probably overkill.
Answered By - Kieveli
Answer Checked By - Cary Denson (JavaFixing Admin)