mavenspring-bootspring-boot-maven-plugingmavenplus

Spring Boot 1.4 to 1.5, unable to deploy


I have a very large and working Spring Boot project that is running OK with Boot 1.4.2. When I try to upgrade to 1.5.3 it works from my IDE (Intellij Idea) but it does not work on deployment. It's a Maven project, so I use the "package" directive to generate a WAR file and I get the error bellow on deployment. From what I can see, it says something is missing on the WAR but I even inspected it and the files are there... Any ideas?

Caused by: java.io.FileNotFoundException: file:(...)/target/ultraip-intranet-2.0-RELEASE.war*/WEB-INF/classes/com/ultraip/intranet/entities (No such file or directory)
    at java.util.zip.ZipFile.open(Native Method) ~[na:1.8.0_131]
    at java.util.zip.ZipFile.<init>(ZipFile.java:219) ~[na:1.8.0_131]
    at java.util.zip.ZipFile.<init>(ZipFile.java:149) ~[na:1.8.0_131]
    at java.util.jar.JarFile.<init>(JarFile.java:166) ~[na:1.8.0_131]
    at java.util.jar.JarFile.<init>(JarFile.java:103) ~[na:1.8.0_131]
    at org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingJarResources(PathMatchingResourcePatternResolver.java:593) ~[spring-core-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
    at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:475) ~[spring-core-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
    at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:279) ~[spring-core-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
    at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.buildDefaultPersistenceUnitInfo(DefaultPersistenceUnitManager.java:525) ~[spring-orm-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
    ... 105 common frames omitted

Screenshot of the generated WAR file https://i.sstatic.net/Dpq9e.jpg


Solution

  • A change was made in Tomcat such that it now uses a * as the separator in war:file: URLs. This broke Spring Framework's resource resolution where the * was incorrectly interpreted as a wildcard.

    The problem should have been been fixed in Spring Framework 4.3.8 which is used in Spring Boot 1.5.3 but it appears that you have found a case that wasn't considered. Can you please open a Spring Boot issue with a small sample that reproduces the problem?

    You don't see the problem when you package your application as a jar file as that stops Tomcat from producing war:file: URLs for resources.