Top "Component-scan" questions

Questions regarding using `@ComponentScan` to detect Spring managed components

multiple packages in context:component-scan, spring config

How can I add multiple packages in spring-servlet.xml file in context:component-scan element? I have tried <context:component-scan …

java spring component-scan
Using @ComponentScan or <context:component-scan /> with only one class

I'm maintaining a project with two set of main packages, the project is using Spring and Spring MVC, one of …

spring spring-mvc component-scan
@ComponentScan with multiple configuration class : Annotation Based Configuration

As per Spring Doc- Configures component scanning directives for use with @Configuration classes. Provides support parallel with Spring XML's <…

java spring spring-mvc component-scan
Error Injecting FeignClient from another Project

I am having trouble auto wiring a feign client from another project. It appears that the implementation of the feign …

java spring-cloud component-scan netflix-feign
getServletConfigClasses() vs getRootConfigClasses() when extending AbstractAnnotationConfigDispatcherServletInitializer

What is the difference between getServletConfigClasses() vs getRootConfigClasses() when extending AbstractAnnotationConfigDispatcherServletInitializer. I've been reading a lot sources since this morning …

java spring spring-mvc configuration component-scan
Component Scan not scanning sub packages

I have encountered a strange problem. I am under the impression that component scan scans the sub packages recursively if …

spring maven spring-data-jpa component-scan
SpringBootApplication exclude when ComponentScanning other @SpringBootApplications

I'm having some difficulty preventing Spring Boot from auto configuring some classes (in this example: SolrAutoConfiguration). To illustrate I've setup …

java solr spring-boot component-scan
Spring Boot: autowire beans from library project

I'm struggling to autowire beans from my custom library, imported with gradle. after reading couple of similar topics I am …

spring-boot spring-data-jpa multi-module spring-ioc component-scan
@ComponentScan not working in test with spring-boot-starter-test

I am attempting to test my @Service and @Repository classes in my project with spring-boot-starter-test and @Autowired is not working …

java spring unit-testing spring-boot component-scan
How to configure controller in spring without component scanning in xml?

I have to design a very large scale project for a bank using spring mvc. I already choose to go …

java spring spring-mvc dependency-injection component-scan