我正在阅读official manual,试图建立一个v2.0.1
spring-boot-admin
项目。编译该项目时,发生了错误。
“错误:(17,23)java:无法访问javax.servlet.Filter找不到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();
}
}
}
答案 0 :(得分:0)
尝试添加依赖项,我遇到了同样的错误,添加以下内容后已解决
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>