Please help me to figure out the problem: We have 2 servers(old and new). And on the old server code works good, but on the new server this code doesn't work:
XWPFDocument doc;
try {
doc = new XWPFDocument((InputStream) this.getClass().getClassLoader().getResource(filePath).getContent());
} catch (IOException e) {
e.printStackTrace();
}
From logs:
java.net.UnknownServiceException: no content-type
at java.net.URLConnection.getContentHandler(URLConnection.java:1241)
at java.net.URLConnection.getContent(URLConnection.java:740)
at java.net.URL.getContent(URL.java:1081)
The File path leads to docx file which is stored inside resources of one the modules of application. (And of course I've checked the existence of file.) So the UrlResource is
UrlResource:jar:file:/tomcat/webapps/ourApplication/WEB-INF/lib/moduleName.jar!/internalResourseFolderStructure/file.docx
About servers: They have a little bit different Tomcat versions: old - Tomcat 9.0.19.0 new - Tomcat 9.0.33.0
Maybe you can get me some tips how to debug it? (I am totally sure that it is something with server(Tomcat settings or something), but I don't know on this step how can debug such)