Hi All
I need to do the following:
class MyApplicationContext: AnnotationConfigApplicationContext {
constructor(): super() // This must be default
constructor(beanFactory: DefaultListableBeanFactory): super(beanFactory)
constructor(annotatedClass: Class<*>): super(annotatedClass)
constructor(vararg basePackages: String): super(*basePackages)
}
but with this code I get a runtime exception like:
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.my.app.MyApplicationContext]: No default constructor found; nested exception is java.lang.NoSuchMethodException
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:127)
at org.springframework.boot.SpringApplication.createApplicationContext(SpringApplication.java:598)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:324)
Kotlin v 1.2.71
Is there a way to have all overrided Java constructors together with the primary constructor?
Thanks.