Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-6592

context:component-scan broken for Eclipse/Equinox after upgrade to Spring 3.0

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0 GA
    • Fix Version/s: 3.0.1
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      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)
      ...

        Attachments

          Activity

            People

            • Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              khoerder Kai Hoerder
              Last updater:
              Trevor Marshall
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                8 years, 20 weeks, 3 days ago