Kotlin instance variable is null when accessed by Spring proxied class
问题 I have a service class that is being proxied by Spring, like so: @Service @Transactional open class MyService { ... } If I remove the open modifier, Spring complains that it needs to proxy the class to apply the @Transactional annotation tweaks. However, this is causing issues when calling a function on the proxied service, which attempts to access a variable: @Service @Transactional open class MyService { protected val internalVariable = ... fun doWork() { internalVariable.execute() //