我正在开发一个基于 Spring Boot 的项目,到目前为止我使用的是 2.1.7。当我开始使用 HateOas 部分时,我决定使用更新的 HATEOAS 1.0,因此我升级了我的应用程序,以便使用 Spring Boot 2.2.0。
我对应用程序所做的唯一更改是:
- 在应用的父pom中更改Spring Boot的版本(Spring Boot为父)
- 通过运行 hateoas 团队提供的脚本来适应 HATEOAS 1.0 中的变化。
之后,所有构建问题都消失了,但是我不能再让我的应用程序再次启动,因为它失败了,因为某个 jdbc 类不在类路径中:
20:22:04.219 调试 org.springframework.boot.diagnostics.FailureAnalyzers - FailureAnalyzer org.springframework.boot.autoconfigure.jdbc.HikariDriverConfigurationFailureAnalyzer@2f254559 失败
20:22:04.219 DEBUG org.springframework.boot.diagnostics.FailureAnalyzers - FailureAnalyzer org.springframework.boot.autoconfigure.jdbc.HikariDriverConfigurationFailureAnalyzer@2f254559 failed java.lang.TypeNotPresentException: Type org.springframework.jdbc.CannotGetJdbcConnectionException not present at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117) ~[?:?] at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) ~[?:?]
at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[?:?]
at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[?:?]
at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[?:?]
at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[?:?]
at sun.reflect.generics.repository.ClassRepository.computeSuperclass(ClassRepository.java:104) ~[?:?]
at sun.reflect.generics.repository.ClassRepository.getSuperclass(ClassRepository.java:86) ~[?:?]
at java.lang.Class.getGenericSuperclass(Class.java:949) ~[?:?]
at org.springframework.core.ResolvableType.getSuperType(ResolvableType.java:467) ~[spring-core-5.2.0.RELEASE.jar:5.2.0.RELEASE]
at org.springframework.core.ResolvableType.as(ResolvableType.java:456) ~[spring-core-5.2.0.RELEASE.jar:5.2.0.RELEASE]
at org.springframework.core.ResolvableType.forClass(ResolvableType.java:1035) ~[spring-core-5.2.0.RELEASE.jar:5.2.0.RELEASE]
at org.springframework.boot.diagnostics.AbstractFailureAnalyzer.getCauseType(AbstractFailureAnalyzer.java:56) ~[spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.boot.diagnostics.AbstractFailureAnalyzer.analyze(AbstractFailureAnalyzer.java:33) ~[spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.boot.diagnostics.FailureAnalyzers.analyze(FailureAnalyzers.java:110) [spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.boot.diagnostics.FailureAnalyzers.reportException(FailureAnalyzers.java:103) [spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.boot.SpringApplication.reportFailure(SpringApplication.java:816) [spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:801) [spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:325) [spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) [spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at com.softuarium.celsvs.webapp.CelsvsWebApp.main(CelsvsWebApp.java:14) [classes/:?]
环境:
- Eclipse STS 4(版本:4.6.0.RELEASE,内部版本 ID:202003181317)
- VM-ubuntu18-ES2698:~/celsvs/celsvs-webapp$ java -version openjdk 版本 "11.0.6" 2020-01-14 OpenJDK 运行时环境 (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1) OpenJDK 64 -Bit Server VM (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1, 混合模式)
- VM-ubuntu18-ES2698:~/celsvs/celsvs-webapp$ mvn -version Apache Maven 3.6.0 Maven 主页:/usr/share/maven Java 版本:11.0.6,供应商:Ubuntu,运行时:/usr/lib/jvm /java-11-openjdk-amd64 默认语言环境:en_US,平台编码:UTF-8 操作系统名称:“linux”,版本:“5.3.0-46-generic”,arch:“amd64”,家族:“unix”
我在 github 的特定分支中进行了所有更改。如果有人想嗅探,请随时克隆 repo:https ://github.com/asjp1970/celsvs.git并跟踪分支https://github.com/asjp1970/celsvs/tree/celsvs_0-1- 0_uplift-spring-2.2.0