Top "Autowired" questions

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

@Autowired bean is null when referenced in the constructor of another bean

Shown below is a snippet of code where I try and reference my ApplicationProperties bean. When I reference it from …

java spring autowired
Why can't we autowire static fields in spring?

Why can't we autowire the static instance variable in the Spring bean. I know there is another way to achieve …

spring autowired
spring boot autoconfiguration with jdbc template autowiring dataSource issue

I'm new to Spring and to J2EE in general. I'm having trouble using JDBC template with Spring Boot autoconfiguration. …

spring jdbc datasource spring-boot autowired
Spring Boot - Environment @Autowired throws NullPointerException

I have a project setup using Spring Boot 0.5.0.M5. In one of the configuration files I am trying to @Autowire …

java spring-boot nullpointerexception autowired environment
what are @Repository and @Autowired used for. (Spring)

I am learning java for 3 months and sometimes i can not understand the usage purpose of something. one topic was …

java spring annotations repository autowired
Spring autowire a list

Is it possible to use @Autowired with a list? Like I have properties file with mimetypes and in my class …

spring list autowired
@Autowired in static classes

This is an Spring MVC project with Hibernate. I'm, trying to make a Logger class that, is responsible for inputting …

spring hibernate spring-mvc autowired static-classes
Autowired Environment is null

I have an issue with connecting environment to my Spring project. In this class @Configuration @ComponentScan(basePackages = "my.pack.offer.*") @…

java spring properties environment autowired
Spring circular reference example

I have a circular reference in one of my projects at work using spring, which I am unable to fix, …

java spring dependency-injection autowired circular-reference
How does Mockito @InjectMocks work?

Here's my question: I have several web services classes to test that all inherit their methods from a generic service. …

spring dependency-injection mockito autowired