升级Spring Boot 3时出现java.lang.NoSuchMethodError问题求助
Spring Boot 3升级及Spring Cloud适配问题
原应用基于Spring Boot 2.7.13 + Spring Security 5.8.4运行正常,目前正在升级到Spring Boot 3.x版本,已完成相关适配修改,但切换到Spring Boot 3后,升级Spring Cloud时遇到问题。
7月10日更新
已清理依赖管理配置,但项目的securityConfig.java仍引用旧版本(5.7.7)的@EnableWebSecurity注解。
相关版本信息及pom文件片段
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.0.8</version> <relativePath/> <!-- lookup parent from repository --> </parent> //I want to share I have modules that also have a pom in each but they only have spring-booot-starter-web in their dependencies block without specifying version. <modules> <module>module1</module> <module>module2</module> <module>module3</module> <module>app</module> </modules> <properties> <java.version>17</java.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <google-cloud-gcp-dependencies.version>4.5.1</google-cloud-gcp-dependencies.version> <spring-cloud.version>2022.0.3</spring-cloud.version> <jsoup.version>1.10.2</jsoup.version> <h2.version>1.4.200</h2.version> <apache-common-text>1.10.0</apache-common-text> <modelmapper.version>2.3.5</modelmapper.version> <com.jayway.jsonpath.version>2.6.0</com.jayway.jsonpath.version> <flyway-core.version>9.5.1</flyway-core.version> <spring-cloud-function.version>4.0.0</spring-cloud-function.version> <postgresql.version>42.4.3</postgresql.version> <snakeyaml.version>1.32</snakeyaml.version> <properties> <dependencyManagement> <dependency> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-dependencies</artifactId> <version>${google-cloud-gcp-dependencies.version}</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-oauth2-client</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-config</artifactId> </dependency> <dependency> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-starter-secretmanager</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-bootstrap</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-core</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-stream-binder-rabbit</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-stream-test-binder</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-cache</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-test</artifactId> <version>${spring-security.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf-spring6</artifactId> <version>3.1.1.RELEASE</version> </dependency> </dependencies>
补充说明:项目还包含PostgreSQL、H2依赖,以及一个已移除废弃方法的第三方依赖,如需相关细节可补充提供。
内容的提问来源于stack exchange,提问作者chocokoala
相关产品推荐
相关产品推荐

