Top "Autowired" questions

Autowiring is a DI container feature where the dependencies are automatically looked for according to some criteria.

Spring Autowiring only works with Interface

I am quite new to spring framework and came across the following issue. I have an interface ClassA, which is …

java spring autowired
How to autowire this TokenStore

How do I trigger auto-logout of this sample Spring Boot OAuth2 app? I tried adding the following code from an …

spring spring-security spring-boot autowired spring-oauth2
Spring creating multiple instances of a singleton?

I have a graph of Spring beans which autowire each other. Heavily simplified illustration: <context:annotation-config/> <bean …

java spring singleton autowired applicationcontext
Using @Spy and @Autowired together

I have a Service Class with 3 methods, Service class is also using some @Autowired annotations. Out of 3 methods, I want …

java spring testing autowired spy
Does Spring @Autowired inject beans by name or by type?

I am reading beginning spring (wiley press) book. In chapter 2 there is an example about Java configuration and @Autowired. It …

java spring configuration code-injection autowired
How to use Spring Autowired (or manually wired) in Scala object?

I am trying to use Spring with Scala. I know Autowired works with Scala class, but I am using a …

spring scala lift autowired
Spring inject without autowire annotation

I find some answer: https://stackoverflow.com/a/21218921/2754014 about Dependency Injection. There isn't any annotation like @Autowired, @Inject or @Resource. …

java spring dependency-injection annotations autowired
Failed Autowired of BuildProperties Spring Boot 2.1.5 & eclipse

I'm creating a very simple application with a few REST API's and it's currently working correctly until I try to …

java spring-boot autowired
Autowiring BuildProperties bean from Gradle - NoSuchBeanDefinitionException

I am trying to obtain the version in my Java application from the Gradle build file. I am following the …

spring spring-boot gradle autowired
Symfony 4 argument has no type-hint, you should configure its value explicitly

Symfony 4.2.3 Recently upgraded from version 3.4 to 4.2.3 and got my project working, but when setting autoconfigure in services.yaml to true, …

service autowired symfony-4.2