mp
07/13/2022, 12:57 PMNo default constructor found; nested exception is java.lang.NoSuchMethodException
on configuration class loading(with sb 2.6 and 2.7) that have been properly loaded(with SB 2.5) with constructor injection
have I missed some important about bean configuration process updates?Mikhail
07/13/2022, 1:38 PMmp
07/13/2022, 1:43 PMMikhail
07/13/2022, 1:44 PMplugins {}
and the affected @Configuration
class?mp
07/13/2022, 1:50 PMapply plugin: "kotlin-jpa"
apply plugin: "kotlin-spring"
Mikhail
07/13/2022, 1:53 PMplugins {}
block instead?mp
07/13/2022, 1:56 PM@Entity
, @Embeddable
, and @MappedSuperclass
no-arg annotations automatically`
• spring - makes open @Component @Async @Transactional @Cacheable @SpringBootTest
Mikhail
07/13/2022, 1:59 PMmp
07/13/2022, 2:17 PMThomas
07/13/2022, 2:28 PM@Configuration
class TodoService(
private val todoRepository: TodoRepository,
private val todoListRepository: TodoListRepository
) {
That`s your code?mp
07/13/2022, 2:29 PMThomas
07/13/2022, 2:31 PMmp
07/13/2022, 2:32 PM@ConstructorBinding
@ConfigurationProperties("smart-server")
data class SmartServerProperties(
blablablah
) {
and another bean class
class OneLineSmartServerLogger: Logger {
private val lines = mutableListOf<String>()
private val logger = Logger.DEFAULT
override fun log(message: String) {
lines.add(message)
if (message.startsWith("BODY END")) {
logger.log(lines.joinToString(separator = "\n"))
lines.clear()
}
}
}
for ktorThomas
07/13/2022, 2:34 PMmp
07/13/2022, 2:35 PMThomas
07/13/2022, 2:37 PMmp
07/13/2022, 2:38 PM@Bean
fun ktorClient(
smartServerProperties: SmartServerProperties,
@Value("\${http.connection-timeout}") httpConnectTimeout: Long,
@Value("\${http.read-timeout}") httpReadTimeout: Long
) =
so it was my fail to try inject
@ConstructorBinding
@ConfigurationProperties("smart-server")
data class SmartServerProperties(
to Configuration and missunderstanding of initialisation flow
Tnx for your replies!