spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.09k stars 40.67k forks source link

Try to avoid scanning some locations twice for TLDs when starting an executable war #6216

Open wilkinsona opened 8 years ago

wilkinsona commented 8 years ago

Jasper scans both WEB-INF/lib and the class loader hierarchy for TLDs. StandardJarScanner does contains some logic that should avoid duplicate scanning:

if (processedURLs.contains(url)) {
    // Skip this URL it has already been processed
    continue;
}

However, the URLs from WEB-INF/lib and the classpath do not matching up. For example:

jar:file:/Users/awilkinson/dev/workspaces/spring/spring-boot/master/gh-6177/target/gh-6177-0.0.1-SNAPSHOT.war!/WEB-INF/lib/archaius-core-0.7.4.jar
jar:file:/Users/awilkinson/dev/workspaces/spring/spring-boot/master/gh-6177/target/gh-6177-0.0.1-SNAPSHOT.war!/WEB-INF/lib/archaius-core-0.7.4.jar!/

The first is returned from the ServletContext, the second comes from the class loader and is created by our JarFile implementation.

A couple of possibilities:

wilkinsona commented 7 years ago

This is still a problem, although the duplicate URLs now have a slightly different form. For example:

war:file:/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-samples/spring-boot-sample-web-jsp/target/spring-boot-sample-web-jsp-2.0.0.BUILD-SNAPSHOT.war*/WEB-INF/lib/spring-core-5.0.0.BUILD-SNAPSHOT.jar
jar:file:/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-samples/spring-boot-sample-web-jsp/target/spring-boot-sample-web-jsp-2.0.0.BUILD-SNAPSHOT.war!/WEB-INF/lib/spring-core-5.0.0.BUILD-SNAPSHOT.jar!/