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

ConfigurationClassUtils fails to introspect inner classes with dot name syntax (and silently ignores it)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 3.2.11, 4.1.1
    • Fix Version/s: 3.2.12, 4.0.8, 4.1.2
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      ConfigurationClassUtils.checkConfigurationClassCandidate(…) tries to create a MetadataReader for the class name of the BeanDefinition to be checked. If that lookup fails (e.g. because one misspelled the classname in an XML configuration file), the resulting IOException will only appear in the debug logs.

      As we're inspecting a BeanDefinition about to be used, not being able to create a MetadataReader indicates a more fundamental problem with the configuration and should probably be at least logged at a more severe log level.

      Another option would be to fix the inconsistency in ClassUtils (ultimately used by the MetadataReader implementations) which currently has some methods (e.g. forName(…)) that mitigate different styles of demarcating an inner class (.-separated VS. $-separated) while some other methods (e.g. (convertClassNameToResourcePath(…)) don't seem to apply this mitigation.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              olivergierke Oliver Drotbohm
              Last updater:
              Spring Issues Spring Issues
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 30 weeks, 2 days ago