You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If @ConstructorBinding is used on a Kotlin data class without a dependency on kotlin-reflect, the annotation isn't found and autowiring is attempted instead. This leads to a failure like this:
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of constructor in ind.ericjturley.mcve.configurationproperties.PushServicesProperties1 required a bean of type 'ind.ericjturley.mcve.configurationproperties.PushServicesProperties1$SnsClient' that could not be found.
Action:
Consider defining a bean of type 'ind.ericjturley.mcve.configurationproperties.PushServicesProperties1$SnsClient' in your configuration.
Consider adding @ConstructorBinding to ind.ericjturley.mcve.configurationproperties.PushServicesProperties1 if you intended to use constructor-based configuration property binding.
The second action is wrong as the class is already annotated with @ConstructorBinding. It would be nice to fail in a more helpful way, for example by detecting that it's a Kotlin class but kotlin-reflect is missing.
If
@ConstructorBinding
is used on a Kotlin data class without a dependency onkotlin-reflect
, the annotation isn't found and autowiring is attempted instead. This leads to a failure like this:The second action is wrong as the class is already annotated with
@ConstructorBinding
. It would be nice to fail in a more helpful way, for example by detecting that it's a Kotlin class butkotlin-reflect
is missing.With thanks to @ericjturley, the problem can be reproduced with https://github.com/ericjturley/mcve-configurationproperties.
The text was updated successfully, but these errors were encountered: