spring-projects / spring-projects/spring-boot
Try to avoid scanning some locations twice for TLDs when starting an executable war
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
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:
- Remove the
!/suffix so that the URLs match - Disable scanning of the classpath when launching an executable war. I think this will work as the war is intended to be self-contained, i.e. all of the TLDs should be packaged in the jar in
WEB-INF/classesor in a jar inWEB-INF/lib. Jasper will find them in either of these locations with also looking at the class path.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with StandardJarScanner and the JarFile implementation, then trace how Jasper receives URLs from WEB-INF/lib and the class loader when launching an executable WAR. Compare the two URL forms and verify that the chosen change prevents duplicate TLD scanning without missing TLDs packaged in WEB-INF/classes or WEB-INF/lib.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100