Skip to content

context:component-scan broken for Eclipse/Equinox after upgrade to Spring 3.0 [SPR-6592] #11258

@spring-projects-issues

Description

@spring-projects-issues

Kai Hoerder opened SPR-6592 and commented

After upgrading from Spring 2.5.6 to Spring 3.0.0.RELEASE, context:component-scan did not work anymore (see stack trace below).

Inserting the line
"rootDirResource = resolveRootDirResource(rootDirResource);"
into PathMatchingResourcePatternResolver.findPathMatchingResources, line 343, directly after
"for (Resource rootDirResource : rootDirResources) {"
fixed it.

Deployment-Scenario: The application resides in a jar inside an Eclipse RCP. The exception is thrown while instantiating a new ClassPathXmlApplicationContext.

Stack trace:

21:36:21,762 WARN org.springframework.core.io.support.PathMatchingResourcePatternResolver - Cannot search for matching files underneath URL [bundleresource://7.fwk1301078346/khoerder/traders/] because it does not correspond to a directory in the file system
java.io.FileNotFoundException: URL [bundleresource://7.fwk1301078346/khoerder/traders/] cannot be resolved to absolute file path because it does not reside in the file system: bundleresource://7.fwk1301078346/khoerder/traders/
at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:204)
at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:51)
at org.springframework.core.io.UrlResource.getFile(UrlResource.java:168)
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingFileResources(PathMatchingResourcePatternResolver.java:529)
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:350)
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:269)
at org.springframework.context.support.AbstractApplicationContext.getResources(AbstractApplicationContext.java:1156)
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:204)
...


Affects: 3.0 GA

Referenced from: commits 998aa14

1 votes, 1 watchers

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions