Kotlin使用Spring boot, Autowired的类会为null
感觉是因为spring boot代理导致多次载入不同的类实体.
解决方案,使用官网的all-open插件.
https://kotlinlang.org/docs/all-open-plugin.html
注意:代码内不要使用open,保留默认的final。
Kotlin使用Spring boot, Autowired的类会为null
感觉是因为spring boot代理导致多次载入不同的类实体.
解决方案,使用官网的all-open插件.
https://kotlinlang.org/docs/all-open-plugin.html
注意:代码内不要使用open,保留默认的final。