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

Kotlin bean instantiation regression with default declared constructor

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 5.0 RC3
    • Fix Version/s: 5.0 RC4
    • Component/s: None
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      SPR-15673 is the original report of the issue.

      With Spring Boot 2.0 M3:

      @ConfigurationProperties("foo")
      class FooProperties(
          var bar: String = "bar",
          var baz: Int = 1
      )
      

      Generates this stacktrace:

      Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [de.techdev.xyz.FooProperties]: No corresponding Kotlin constructor found
              at org.springframework.beans.BeanUtils$KotlinDelegate.instantiateClass(BeanUtils.java:742) ~[spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
              at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:165) ~[spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
              at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:88) ~[spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
      

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              sdeleuze S├ębastien Deleuze
              Reporter:
              lewis Lewis
              Last updater:
              St├ęphane Nicoll
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                6 weeks, 4 days ago