gpt4 book ai didi

java - 关于 spring-boot-admin ,客户端配置

转载 作者:太空宇宙 更新时间:2023-11-04 10:18:43 26 4
gpt4 key购买 nike

我正在阅读 official manual尝试构建 v2.0.1 spring-boot-admin 项目。当我编译该项目时,发生了错误。

"Error:(17, 23) java: Unable to access javax.servlet.Filter Could not find the class file for javax.servlet.Filter"

我正在尝试添加新的 dependency以防止发生此错误。但没有成功。

这是我的配置代码,请教我怎么做才能让客户端正常启动。 My code

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

@SpringBootApplication

public class Adminclient21Application {

public static void main(String[] args) {
SpringApplication.run(Adminclient21Application.class, args);
}
@Configuration
public static class SecurityPermitAllConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().permitAll()
.and().csrf().disable();
}
}
}

最佳答案

尝试添加依赖项,我遇到了同样的错误,添加以下内容后解决了

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

关于java - 关于 spring-boot-admin ,客户端配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51397082/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com