首页 > TAG信息列表 > component-scan

春季启动:测试和主要之间的NoUniqueBeanDefinitionException

我有一个SpringBoot main / Application.java类 @SpringBootApplication @ComponentScan(value = "com.nfl.dm.shield", excludeFilters = { @ComponentScan.Filter(value = MemoryRepository.class, type = FilterType.ASSIGNABLE_TYPE)

java – 如何在不使用ComponentScan的情况下启动Spring Boot Web应用程序

我试图避免组件扫描,以减少我们的模块测试和一般的Web应用程序中的启动时间. 当我用@SpringBootConfiguration @EnableAutoConfiguration替换@SpringBootApplication时,我收到以下错误: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFa

java – Spring:为什么在每个测试类的末尾没有调用@PreDestroy?

我有一个集成测试类,注释如下 @WebAppConfiguration @ContextConfiguration(classes = {AppConfiguration.class}) @RunWith(SpringJUnit4ClassRunner.class) public class CacheConsumerTest { } 这是我的AppConfiguration @Configuration @ComponentScan(basePackage

spring – 分层上下文的范围

我读过了: Multiple component-scan What is the difference between ApplicationContext and WebApplicationContext in Spring MVC? @RequestMapping annotation not working if <context:component-scan /> is in application context instead of dispatcher context(稍后会