我正在阅读官方手册,试图构建一个v2.0.1 spring-boot-admin项目。当我编译项目时,出现错误。“错误:(17, 23) java:无法访问 javax.servlet.Filter 找不到 javax.servlet.Filter 的类文件”我正在尝试添加新的依赖项以防止发生此错误。但它没有成功。这是我的配置代码,请问怎么做才能让客户端正常启动。我的代码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;@SpringBootApplicationpublic 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(); } }}
1 回答
一只斗牛犬
TA贡献1784条经验 获得超2个赞
尝试添加依赖项,我遇到了同样的错误,添加以下内容后解决
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
添加回答
举报
0/150
提交
取消