我在使用 Spring Cloud Gateway 时遇到问题
是否有任何依赖项直接或递归调用 spring-boot-starter-tomcat
它不起作用,因为它将启动嵌入式 tomcat 服务器而不是 spring 云网关使用的 netty 服务器
我开始通过排除这个依赖来解决这个问题
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
spring 云网关成功运行
但有时我想使用 spring-cloud-starter-oauth2 来使用 @EnableOAuth2Sso
我开始使用
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
那时我面临着抛出异常的大问题
原因:java.lang.IllegalStateException:无法自省类 org.springframework.security.oauth2.config.annotation.web.configuration.OAuth2ClientConfiguration 上的注释方法......
引起:java.lang.NoClassDefFoundError: javax/servlet/Filter