Top "Spring-ioc" questions

The Spring IoC is a core component of the Spring Framework.

Update bean property at runtime

I have a bean that holds some configuration: public class CustomerService{ private Config config; @Required public void setConfig(Config config){ …

java spring spring-ioc
Two beans with the same name results in ConflictingBeanDefinitionException despite using @Primary

I have an application initializer class that is used to insert application specific data to database. @Component("applicationInitializer") public class …

java spring inversion-of-control spring-ioc
Autowire doesn't work for custom UserDetailsService in Spring Boot

The spring boot apps starts up, tomcat runs, and then it throws an error before finally dying. Error Running my …

java spring spring-boot spring-ioc
BeanPostProcessor with @Bean annotation not working

I'm trying to create a BeanPostProcessor for registering some values to a Map. The BeanPostProcessor works fine if I'm create …

spring spring-ioc
How do Spring annotations work?

Motivation As a follow-up to my previous questions on classloading How is the Classloader for a class chosen? How Classloader …

spring annotations classloader spring-ioc
spring boot @Autowired a bean from another module

My question is how can i add a package to my list of component to scan @ComponentScan(basePackages = {"io.swagger", "…

spring-boot spring-ioc
How to use Session Scoped Component in Controller

Count.java: @Component @Scope(value = "session",proxyMode = ScopedProxyMode.TARGET_CLASS) public class Count { Integer i; public Count() { this.i = 0; } Controller: @…

spring spring-mvc dependency-injection spring-boot spring-ioc
Interfaces are annotated with @Component annotation in spring IoC/DI. What could be the reason?

Some times interfaces are annotated with @Component annotation. Then my obvious reasoning was that classes that implement such interface will …

java spring dependency-injection inversion-of-control spring-ioc
Spring Unsatisfied dependency Errors

EDIT I am updating this with new information that is more relevant to finding an answer. The problem is that …

java spring-ioc
How to check for Request Scope availability in Spring?

I'm trying to setup some code that will behave one way if spring's request scope is available, and another way …

java spring spring-mvc spring-ioc