-
Notifications
You must be signed in to change notification settings - Fork 38.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PathMatchingResourcePatternResolver
provides duplicate resources when using classpath*:
prefix combined with ant-style [SPR-15989]
#20539
Comments
Juergen Hoeller commented Running the attached app, all I can see are regular entries along the lines of I'm pretty sure this only happens when searching for such patterns in the root of your jar files... since the root of such files is unfortunately not easily discoverable with a standard |
Christophe Blanchard commented I do reproduce the problem as well : "C:\Program Files\Java\jdk1.8\bin\java.exe" -jar target/resources-0.0.1-SNAPSHOT.jar file:/D:/tmp/resources/resources/target/resources-0.0.1-SNAPSHOT.jar!/ The problem does not appear when running with spring-boot-maven-plugin instead of maven-shade-plugin. weird... |
Maël OUAHI commented thanks for your reply, i confirm that the problem does not appear when i put the file into subdirectory, but i reproduce the problem when i run the app on windows 7 OS and centOs 7. |
Juergen Hoeller commented I'm afraid I still can't reproduce the problem on Windows 10 here... but it indeed seems to be related to the maven-shade-plugin. Any chance you could attach a debugger to this? Which |
Maël OUAHI commented I reproduce the problem when using maven-assembly-plugin to create the fat jar instead of maven-shade-plugin. |
Juergen Hoeller commented I can reproduce the problem as well now: on JDK 8 but not on JDK 9 (which I was accidentally always running on before - sorry). On JDK 9, the system class loader never extends I'll try to sanitize the paths in our code accordingly before adding them to the result set, properly identifying the same jar there and only including it once. |
Juergen Hoeller commented We're explicitly checking for duplicates in This is in master now for the 5.0 GA release. I'll also backport it to 4.3.12 later today. It'd be great if you could give |
Maël OUAHI commented thanks for you responsiveness, let me know when backporting was done and i will try it. |
Maël OUAHI commented It's OK. I tried it and this is the output
|
Udayakumar commented I am facing exactly the same issue even with 5.0.1.RELEASE. |
Juergen Hoeller commented Udayakumar, could you please create a new JIRA issue for your scenario? Please dump the full URLs that you're seeing, like above... Plain slash differences shouldn't matter since |
Udayakumar commented Thanks. opened a new issue. |
PathMatchingResourcePatternResolver
provides duplicate resources when using classpath*:
prefix combined with ant-style [SPR-15989]
Maël OUAHI opened SPR-15989 and commented
PathMatchingResourcePatternResolver provides duplicate resources when using "classpath*" prefix combined with Ant-style patterns.
I'll attach an application that reproduces the problem.The application uses the location pattern "classpath*:/*-perm.json" to resolve Resources.
If you package and run it
You should see the following output:
Affects: 4.3.8, 4.3.9, 4.3.10, 4.3.11
Attachments:
Issue Links:
PathMatchingResourcePatternResolver
returns duplicate resources when usingclasspath*:
prefix [SPR-16117] #20665 PathMatchingResourcePatternResolver returns duplicate resources when using classpath* prefixReferenced from: commits 9d8e3d4, a839477
Backported to: 4.3.12
The text was updated successfully, but these errors were encountered: