Skip to content
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 failing against non-jar file in classpath #34417

Closed
finn0s opened this issue Feb 12, 2025 · 3 comments
Closed
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: regression A bug that is also a regression
Milestone

Comments

@finn0s
Copy link

finn0s commented Feb 12, 2025

Since version 6.2.0-RC3 / #33705 the PathMatchingResourcePatternResolver throws an java.util.zip.ZipException: zip file is empty Exception when a none jar file is in the classpath.
I use IntelliJ to Build with maven, and IntelliJ adds a .license file to the class path. There is already an issue in IntelliJ Youtrack opend 2021.
https://youtrack.jetbrains.com/issue/IDEA-262695/Maven-plexus-classworlds.license-is-added-to-classpath-breaks-Mwe2

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Feb 12, 2025
@jhoeller
Copy link
Contributor

@finn0s here exactly does this break in PathMatchingResourcePatternResolver? Which line throws that exception, could you share a stacktrace?

I'm going to review this myself on the basis of the #33705 changes, in preparation for the 6.2.3 release which is scheduled for tomorrow. In any case, a concrete pointer would be appreciated.

@jhoeller jhoeller added the in: core Issues in core modules (aop, beans, core, context, expression) label Feb 12, 2025
@jhoeller jhoeller self-assigned this Feb 12, 2025
@jhoeller
Copy link
Contributor

Is this coming out of the jarCon.getJarFile() call in line 840 by any chance? We just catch FileNotFoundException there, not ZipException... in contrast to all other creation of JarFile instances where we catch ZipException already.

@jhoeller jhoeller added type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Feb 12, 2025
@jhoeller jhoeller added this to the 6.2.3 milestone Feb 12, 2025
@jhoeller
Copy link
Contributor

As far as I was able to reproduce this, it is indeed a ZipException coming out of jarCon.getJarFile() in such a case. I'll address this through extending the catch clause there.

@jhoeller jhoeller changed the title The PathMatchingResourcePatternResolver not working with none jar file in the classpath PathMatchingResourcePatternResolver failing against non-jar file in classpath Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

3 participants