我正在尝试为SpringBoot管理员配置Eureka微服务。
完成所有配置后,我可以看到SBA,但大量资源被阻塞,并且在服务控制台中出现以下异常:
java.io.IOException: An established connection was aborted by the software on the host computer
at sun.nio.ch.SocketDispatcher.write0(Native Method) ~[na:1.8.0_121]
at sun.nio.ch.SocketDispatcher.write(SocketDispa
我正在创建一些spring组件,它将是库jar的一部分。
我希望组件由类路径中包含jar的应用程序自动加载。
@Component
public class AComponent {
}
我尝试创建一个配置类并进行组件扫描,但是配置没有加载。
@Configuration
@ComponentScan(BasePackages="")
public class ComponentConfig {
}
你能建议一个解决方案吗?这是一个非spring-boot的应用程序。
我偶然发现了一个从遗留spring转换到Spring Boot的项目的配置类。我看到有两种方式添加拦截器。像这样 @Configuration
public class AppConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor( new MyInterceptorOne()).addPathPatterns("/api/data/**"