localhost:9990与 localhost:8080的连接被拒绝

后端开发 2026-07-11

我们正在把Jenkins作业从Vapp迁移到GridEngine

当我们运行任何测试用例时,我们会看到连接被拒绝,地址为localhost:8080和 localhost:9990

猜测:服务器未为localhost/端口进行配置

如果这是正确的,应该进行哪些检查,修复措施又是什么?

解决方案

为Spring Boot 3更新SecurityConfig

在Spring Boot 3(Spring Security 6)中,WebSecurityConfigurerAdapter 已弃用。您现在应该使用一个 SecurityFilterChain bean,如下所示:

@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
    http
        .csrf(csrf -> csrf.disable())
        .authorizeHttpRequests(auth -> auth
            .requestMatchers("/api/public/**").permitAll()
            .anyRequest().authenticated()
        )
        .httpBasic(Customizer.withDefaults());
    return http.build();
}
站内所有文章版权归属LeftHeroAI导航站,无授权禁止任何主体转载、抄袭、复制内容,亦不得私自架设镜像站点。一经侵权,本站将通过法律途径追责。

相关文章