I have a war file that was built with Maven and it contains all the dependencies it needs (it's a REST service). I am using Java JRE 1.8.0_152, and Tomcat 8.5.24 on both machines. One is a Windows 10 64bit machine, the other a Windows Server 2012 R2 64bit machine. I have built (in Eclipse/Maven) and deployed the war file successfully on the Windows 10 machine, but when I deploy the same war file on the Windows server machine, I get the following error on Tomcat startup (or war file deployment):
13-Dec-2017 14:41:36.603 SEVERE [bla.bla-startStop-1] org.apache.catalina.core.ApplicationContext.log StandardWrapper.Throwable org.glassfish.jersey.server.internal.scanning.ResourceFinderException: The URI scheme war of the URI war:file:/C:/apache-tomcat-8.5.24/webapps/bla.war*/WEB-INF/classes/bla/bla/ is not supported. Package scanning deployment is not supported for such URIs.
Try using a different deployment mechanism such as explicitly declaring root resource and provider classes using an extension of javax.ws.rs.core.Application
And then, a further message that I think is relevant:
13-Dec-2017 14:41:36.615 SEVERE [bla.bla-startStop-1] org.apache.catalina.core.StandardContext.loadOnStartup Servlet [Jersey REST Service] in web application [/bla] threw load() exception
I am using Jersey for the REST stuff, but both machines have identical versions of the JRE and Tomcat installed, and it's the same war file ! (I have even wiped the Tomcat installations and installed from scratch - same thing).
I'm not even sure where to start looking, since all dependencies are contained in the war file (including the jersey jars) and it IS working on the Windows 10 machine; the only thing I find noteworthy is the asterisk in the error message after the war file name ("bla.war*"). I'm not sure where that comes from, or if it's indeed relevant to the root cause of the error.
Any hints/ideas ? Thanks in advance !
The log file is telling you that Tomcat/the JVM is attempting to read the files directly out of the .war file. URI war:file:/C:/apache-tomcat-8.5.24/webapps/bla.war*/WEB-INF/classes/bla/bla/
is not supported. Package scanning deployment is not supported for such URIs. Try using a different deployment mechanism
such as explicitly declaring root resource and provide
So, it looks like different tomcat configurations. Is the Tomcat configuration on the server set to unpack the war? E.g. You need to ensure that unpackWARs==true
is set. Reference: how to make tomcat explode the war files