@jhoeller @sbrannen take a look, please

Who can explain this behavior in Spring: there is an abstract class

abstract class BaseRepo {
    @Autowired
    protected lateinit var dsl: DSLContext
    // ....
}

@Repository
class MyRepo : BaseRepo {
    // ...
}

question: why in case MyRepo is declared as @Repository, the framework does not initialize @Autowired fields – protected lateinit var dsl: DslContext, but if you change @Repository to @Service or @Component, the injection works? This is strange, because @Repository is a subtype of @Component, just at the specification level, but it turns out not, Spring handles them differently.

P.S. I noticed it on Spring Boot 3, I haven't tested it on Spring Boot 2. Constructor injection - do not suggest

Comment From: snicoll

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use the issue tracker only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.

Comment From: l3r8yJ

@snicoll which details I need to add? obviously this issue is a bug, because the unexpected behaviour was described. Also, SO already contains this question. There is no answer around 7 years. I insist to reopen this issue. So, wdyt?

Comment From: snicoll

A sample that demonstrates what you've described that we can clone and run.

Here's one that attempts to reproduce what you've described and it works as expected: https://github.com/snicoll-scratches/demo-32716

There is no answer around 7 years. I insist to reopen this issue. So, wdyt?

That pinging team members and gathering your colleagues to thumb up your issue as soon as it's created is a bit obnoxious. If you provide something that fails the way you've described using only the core spring framework, we can obviously reopen and have a look to it.

Comment From: l3r8yJ

@snicoll okay, if I'll create runnable example using Spring Boot it would be possible to move this issue to Spring Boot repository?