Top "Autowired" questions

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

Is there a way to @Autowire a bean that requires constructor arguments?

I'm using Spring 3.0.5 and am using @Autowire annotation for my class members as much as possible. One of the beans …

spring constructor autowired spring-annotations spring-bean
Requested bean is currently in creation: Is there an unresolvable circular reference?

i am using spring 3, and i have two beans of view scope: 1- Bean1: @Component("bean1") @Scope("view") public class …

spring dependency-injection autowired
Can you use @Autowired with static fields?

Is there some way to use @Autowired with static fields. If not, are there some other ways to do this?

java spring autowired
Autowiring two beans implementing same interface - how to set default bean to autowire?

Background: I have a Spring 2.5/Java/Tomcat application. There is the following bean, which is used throughout the application in …

java spring spring-mvc autowired
How do I mock an autowired @Value field in Spring with Mockito?

I'm using Spring 3.1.4.RELEASE and Mockito 1.9.5. In my Spring class I have: @Value("#{myProps['default.url']}") private String defaultUrl; @Value("#{…

spring mockito autowired value-initialization
spring autowiring with unique beans: Spring expected single matching bean but found 2

I am trying to autowire some beans (for dependency injection) using Spring for a webapp. One controller bean contains another …

spring spring-mvc dependency-injection annotations autowired
Injecting @Autowired private field during testing

I have a component setup that is essentially a launcher for an application. It is configured like so: @Component public …

java spring unit-testing junit autowired
@Autowired and static method

I have @Autowired service which has to be used from within a static method. I know this is wrong but …

java spring static autowired
Exclude subpackages from Spring autowiring?

Is there a simple way to exclude a package / sub-package from autowiring in Spring 3.1? E.g., if I wanted to …

spring autowired
Spring expected at least 1 bean which qualifies as autowire candidate for this dependency

I have a trouble with this Autowire: @Controller public class ChiusuraController { @Autowired private ChiusuraProvider chiusuraProvider; } with this bean: @Service @Transactional …

spring dependency-injection autowired