Java-记一次Springboot版本升级导致的问题

前言

根据相关情况,需要将SpringBoot的版本由原来的2.1.8.RELEASE版本升级至2.3.8.RELEASE。
启动项目后报错:
在这里插入图片描述
具体报错信息如下:

Description: An attempt was made to call a method that does not exist. The attempt was made from the following location: org.springframework.cloud.client.discovery.health.DiscoveryCompositeHealthIndicator.(DiscoveryCompositeHealthIndicator.java:41) The following method did not exist: org.springframework.boot.actuate.health.CompositeHealthIndicator.(Lorg/springframework/boot/actuate/health/HealthAggregator;)V The method’s class, org.springframework.boot.actuate.health.CompositeHealthIndicator, is available from the following locations: jar:file:/C:/Users/EU936ZL/Documents/software/localRepository/org/springframework/boot/spring-boot-actuator/2.3.8.RELEASE/spring-boot-actuator-2.3.8.RELEASE.jar!/org/springframework/boot/actuate/health/CompositeHealthIndicator.class The class hierarchy was loaded from the following locations: org.springframework.boot.actuate.health.CompositeHealthIndicator: file:/C:/Users/EU936ZL/Documents/software/localRepository/org/springframework/boot/spring-boot-actuator/2.3.8.RELEASE/spring-boot-actuator-2.3.8.RELEASE.jar Action: Correct the classpath of your application so that it contains a single, compatible version of org.springframework.boot.actuate.health.CompositeHealthIndicator Disconnected from the target VM, address: ‘127.0.0.1:49214’, transport: ‘socket’ Process finished with exit code 1

分析

该错误信息说明在初始化DiscoveryCompositeHealthIndicator类时,尝试调用了CompositeHealthIndicator类的一个构造方法,但是这个方法在当前类路径中找到的版本里并不存在。具体来说,错误信息指出调用了一个接受HealthAggregator类型参数的构造方法,但是实际的CompositeHealthIndicator类并没有提供这样的构造函数签名。
问题的关键在于项目中可能同时存在多个版本的spring-boot-actuator依赖,或者是某个依赖间接引入了不兼容的spring-boot-actuator版本,导致了类路径(classpath)中存在类定义的冲突。

解决过程

既然是依赖冲突,那么我们就需要去查看pom依赖,然后一步一步的排查究竟是哪里出了问题。

1、检查依赖管理

确保pom.xml(如果是Maven项目)或build.gradle(如果是Gradle项目)中对spring-boot-actuator的版本声明是明确且统一的。避免直接在依赖中指定不同版本的spring-boot-actuator,而是应该在dependencyManagement(Maven)或dependencyResolutionManagement(Gradle)中统一管理版本号

2、清理和重建依赖

执行mvn clean install(Maven)或./gradlew clean build(Gradle)来清理旧的构建产物并重新构建项目,确保使用的是统一且正确的依赖版本

3、查看依赖树

使用mvn dependency:tree(Maven)或./gradlew dependencies(Gradle)命令来分析项目的依赖树,检查是否有其它依赖间接引入了不同版本的spring-boot-actuator。如果有,考虑使用排除(exclusions)来移除冲突的版本。

下面是打印出来的maven依赖树:

[INFO] com.springboot:demo:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.3.8.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:2.3.8.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot:jar:2.3.8.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.3.8.RELEASE:compile
[INFO] |  |  |  +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] |  |  |  |  \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] |  |  |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.13.3:compile
[INFO] |  |  |  \- org.slf4j:jul-to-slf4j:jar:1.7.30:compile
[INFO] |  |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  |  +- org.springframework:spring-core:jar:5.2.12.RELEASE:compile
[INFO] |  |  |  \- org.springframework:spring-jcl:jar:5.2.12.RELEASE:compile
[INFO] |  |  \- org.yaml:snakeyaml:jar:1.26:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:2.3.8.RELEASE:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.11.4:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.11.4:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.11.4:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.11.4:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.3.8.RELEASE:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.41:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.41:compile
[INFO] |  +- org.springframework:spring-web:jar:5.2.12.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-beans:jar:5.2.12.RELEASE:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:5.2.12.RELEASE:compile
[INFO] |     +- org.springframework:spring-aop:jar:5.2.12.RELEASE:compile
[INFO] |     +- org.springframework:spring-context:jar:5.2.12.RELEASE:compile
[INFO] |     \- org.springframework:spring-expression:jar:5.2.12.RELEASE:compile
[INFO] +- com.baomidou:mybatis-plus-boot-starter:jar:3.1.0:compile
[INFO] |  +- com.baomidou:mybatis-plus:jar:3.1.0:compile
[INFO] |  |  \- com.baomidou:mybatis-plus-extension:jar:3.1.0:compile
[INFO] |  |     +- com.baomidou:mybatis-plus-core:jar:3.1.0:compile
[INFO] |  |     |  +- com.baomidou:mybatis-plus-annotation:jar:3.1.0:compile
[INFO] |  |     |  +- org.mybatis:mybatis:jar:3.5.0:compile
[INFO] |  |     |  \- com.github.jsqlparser:jsqlparser:jar:1.4:compile
[INFO] |  |     \- org.mybatis:mybatis-spring:jar:2.0.0:compile
[INFO] |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.3.8.RELEASE:compile
[INFO] |  \- org.springframework.boot:spring-boot-starter-jdbc:jar:2.3.8.RELEASE:compile
[INFO] |     +- com.zaxxer:HikariCP:jar:3.4.5:compile
[INFO] |     \- org.springframework:spring-jdbc:jar:5.2.12.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-elasticsearch:jar:2.3.8.RELEASE:compile
[INFO] |  \- org.springframework.data:spring-data-elasticsearch:jar:4.0.6.RELEASE:compile
[INFO] |     +- org.springframework:spring-tx:jar:5.2.12.RELEASE:compile
[INFO] |     +- org.springframework.data:spring-data-commons:jar:2.3.6.RELEASE:compile
[INFO] |     +- org.elasticsearch.plugin:transport-netty4-client:jar:7.6.2:compile
[INFO] |     |  \- io.netty:netty-codec-http:jar:4.1.58.Final:compile
[INFO] |     +- org.elasticsearch.client:elasticsearch-rest-high-level-client:jar:7.6.2:compile
[INFO] |     |  +- org.elasticsearch.client:elasticsearch-rest-client:jar:7.6.2:compile
[INFO] |     |  |  +- org.apache.httpcomponents:httpasyncclient:jar:4.1.4:compile
[INFO] |     |  |  \- org.apache.httpcomponents:httpcore-nio:jar:4.4.14:compile
[INFO] |     |  +- org.elasticsearch.plugin:mapper-extras-client:jar:7.6.2:compile
[INFO] |     |  +- org.elasticsearch.plugin:parent-join-client:jar:7.6.2:compile
[INFO] |     |  +- org.elasticsearch.plugin:aggs-matrix-stats-client:jar:7.6.2:compile
[INFO] |     |  +- org.elasticsearch.plugin:rank-eval-client:jar:7.6.2:compile
[INFO] |     |  \- org.elasticsearch.plugin:lang-mustache-client:jar:7.6.2:compile
[INFO] |     |     \- com.github.spullara.mustache.java:compiler:jar:0.9.6:compile
[INFO] |     \- com.fasterxml.jackson.core:jackson-core:jar:2.11.4:compile
[INFO] +- org.elasticsearch:elasticsearch:jar:7.6.2:compile
[INFO] |  +- org.elasticsearch:elasticsearch-core:jar:7.6.2:compile
[INFO] |  +- org.elasticsearch:elasticsearch-secure-sm:jar:7.6.2:compile
[INFO] |  +- org.elasticsearch:elasticsearch-x-content:jar:7.6.2:compile
[INFO] |  |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.11.4:compile
[INFO] |  |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.11.4:compile
[INFO] |  |  \- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.11.4:compile
[INFO] |  +- org.elasticsearch:elasticsearch-geo:jar:7.6.2:compile
[INFO] |  +- org.apache.lucene:lucene-core:jar:8.4.0:compile
[INFO] |  +- org.apache.lucene:lucene-analyzers-common:jar:8.4.0:compile
[INFO] |  +- org.apache.lucene:lucene-backward-codecs:jar:8.4.0:compile
[INFO] |  +- org.apache.lucene:lucene-grouping:jar:8.4.0:compile
[INFO] |  +- org.apache.lucene:lucene-highlighter:jar:8.4.0:compile
[INFO] |  +- org.apache.lucene:lucene-join:jar:8.4.0:compile
[INFO] |  +- org.apache.lucene:lucene-memory:jar:8.4.0:compile
[INFO] |  +- org.apache.lucene:lucene-misc:jar:8.4.0:compile
[INFO] |  +- org.apache.lucene:lucene-queries:jar:8.4.0:compile
[INFO] |  +- org.apache.lucene:lucene-queryparser:jar:8.4.0:compile
[INFO] |  +- org.apache.lucene:lucene-sandbox:jar:8.4.0:compile
[INFO] |  +- org.apache.lucene:lucene-spatial:jar:8.4.0:compile
[INFO] |  +- org.apache.lucene:lucene-spatial-extras:jar:8.4.0:compile
[INFO] |  +- org.apache.lucene:lucene-spatial3d:jar:8.4.0:compile
[INFO] |  +- org.apache.lucene:lucene-suggest:jar:8.4.0:compile
[INFO] |  +- org.elasticsearch:elasticsearch-cli:jar:7.6.2:compile
[INFO] |  |  \- net.sf.jopt-simple:jopt-simple:jar:5.0.2:compile
[INFO] |  +- com.carrotsearch:hppc:jar:0.8.1:compile
[INFO] |  +- joda-time:joda-time:jar:2.10.4:compile
[INFO] |  +- com.tdunning:t-digest:jar:3.2:compile
[INFO] |  +- org.hdrhistogram:HdrHistogram:jar:2.1.9:compile
[INFO] |  +- org.apache.logging.log4j:log4j-api:jar:2.13.3:compile
[INFO] |  \- org.elasticsearch:jna:jar:4.5.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-validation:jar:2.3.8.RELEASE:compile
[INFO] |  +- org.glassfish:jakarta.el:jar:3.0.3:compile
[INFO] |  \- org.hibernate.validator:hibernate-validator:jar:6.1.7.Final:compile
[INFO] |     +- jakarta.validation:jakarta.validation-api:jar:2.0.2:compile
[INFO] |     \- org.jboss.logging:jboss-logging:jar:3.4.1.Final:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:jar:2.1.0.RELEASE:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter:jar:2.1.0.RELEASE:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-context:jar:2.1.0.RELEASE:compile
[INFO] |  |  \- org.springframework.security:spring-security-rsa:jar:1.0.7.RELEASE:compile
[INFO] |  |     \- org.bouncycastle:bcpkix-jdk15on:jar:1.60:compile
[INFO] |  |        \- org.bouncycastle:bcprov-jdk15on:jar:1.60:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-netflix-hystrix:jar:2.1.0.RELEASE:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-netflix-eureka-client:jar:2.1.0.RELEASE:compile
[INFO] |  +- com.netflix.eureka:eureka-client:jar:1.9.8:compile
[INFO] |  |  +- org.codehaus.jettison:jettison:jar:1.3.7:runtime
[INFO] |  |  |  \- stax:stax-api:jar:1.0.1:runtime
[INFO] |  |  +- com.netflix.netflix-commons:netflix-eventbus:jar:0.3.0:runtime
[INFO] |  |  |  +- com.netflix.netflix-commons:netflix-infix:jar:0.3.0:runtime
[INFO] |  |  |  |  +- commons-jxpath:commons-jxpath:jar:1.3:runtime
[INFO] |  |  |  |  +- org.antlr:antlr-runtime:jar:3.4:runtime
[INFO] |  |  |  |  |  \- org.antlr:stringtemplate:jar:3.2.1:runtime
[INFO] |  |  |  |  \- com.google.code.gson:gson:jar:2.8.6:runtime
[INFO] |  |  |  \- org.apache.commons:commons-math:jar:2.2:runtime
[INFO] |  |  +- com.netflix.archaius:archaius-core:jar:0.7.6:compile
[INFO] |  |  +- javax.ws.rs:jsr311-api:jar:1.1.1:runtime
[INFO] |  |  +- com.netflix.servo:servo-core:jar:0.12.21:runtime
[INFO] |  |  +- com.sun.jersey:jersey-core:jar:1.19.1:runtime
[INFO] |  |  +- com.sun.jersey:jersey-client:jar:1.19.1:runtime
[INFO] |  |  +- com.sun.jersey.contribs:jersey-apache-client4:jar:1.19.1:runtime
[INFO] |  |  +- org.apache.httpcomponents:httpclient:jar:4.5.13:compile
[INFO] |  |  |  +- org.apache.httpcomponents:httpcore:jar:4.4.14:compile
[INFO] |  |  |  \- commons-codec:commons-codec:jar:1.14:compile
[INFO] |  |  +- com.google.inject:guice:jar:4.1.0:runtime
[INFO] |  |  |  \- aopalliance:aopalliance:jar:1.0:runtime
[INFO] |  |  +- com.github.vlsi.compactmap:compactmap:jar:1.2.1:runtime
[INFO] |  |  |  \- com.github.andrewoma.dexx:dexx-collections:jar:0.2:runtime
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-annotations:jar:2.11.4:compile
[INFO] |  +- com.netflix.eureka:eureka-core:jar:1.9.8:compile
[INFO] |  |  \- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:runtime
[INFO] |  |     +- javax.xml.stream:stax-api:jar:1.0-2:runtime
[INFO] |  |     \- org.codehaus.woodstox:stax2-api:jar:3.1.4:runtime
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-netflix-archaius:jar:2.1.0.RELEASE:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-netflix-ribbon:jar:2.1.0.RELEASE:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-netflix-archaius:jar:2.1.0.RELEASE:compile
[INFO] |  |  \- commons-configuration:commons-configuration:jar:1.8:compile
[INFO] |  |     \- commons-lang:commons-lang:jar:2.6:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-netflix-ribbon:jar:2.1.0.RELEASE:compile
[INFO] |  |  +- com.netflix.ribbon:ribbon:jar:2.3.0:compile
[INFO] |  |  |  +- com.netflix.ribbon:ribbon-transport:jar:2.3.0:runtime
[INFO] |  |  |  |  +- io.reactivex:rxnetty-contexts:jar:0.4.9:runtime
[INFO] |  |  |  |  \- io.reactivex:rxnetty-servo:jar:0.4.9:runtime
[INFO] |  |  |  \- io.reactivex:rxnetty:jar:0.4.9:runtime
[INFO] |  |  +- com.netflix.ribbon:ribbon-core:jar:2.3.0:compile
[INFO] |  |  +- com.netflix.ribbon:ribbon-httpclient:jar:2.3.0:compile
[INFO] |  |  |  +- commons-collections:commons-collections:jar:3.2.2:runtime
[INFO] |  |  |  \- com.netflix.netflix-commons:netflix-commons-util:jar:0.3.0:runtime
[INFO] |  |  +- com.netflix.ribbon:ribbon-loadbalancer:jar:2.3.0:compile
[INFO] |  |  |  \- com.netflix.netflix-commons:netflix-statistics:jar:0.1.1:runtime
[INFO] |  |  \- io.reactivex:rxjava:jar:1.3.8:compile
[INFO] |  +- com.netflix.ribbon:ribbon-eureka:jar:2.3.0:compile
[INFO] |  \- com.thoughtworks.xstream:xstream:jar:1.4.10:compile
[INFO] |     +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] |     \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-openfeign:jar:2.1.0.RELEASE:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-openfeign-core:jar:2.1.0.RELEASE:compile
[INFO] |  |  \- io.github.openfeign.form:feign-form-spring:jar:3.5.0:compile
[INFO] |  |     +- io.github.openfeign.form:feign-form:jar:3.5.0:compile
[INFO] |  |     \- commons-fileupload:commons-fileupload:jar:1.3.3:compile
[INFO] |  |        \- commons-io:commons-io:jar:2.2:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-commons:jar:2.1.0.RELEASE:compile
[INFO] |  |  \- org.springframework.security:spring-security-crypto:jar:5.3.6.RELEASE:compile
[INFO] |  +- io.github.openfeign:feign-core:jar:10.1.0:compile
[INFO] |  +- io.github.openfeign:feign-slf4j:jar:10.1.0:compile
[INFO] |  \- io.github.openfeign:feign-hystrix:jar:10.1.0:compile
[INFO] |     \- com.netflix.hystrix:hystrix-core:jar:1.5.18:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.3.8.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-aop:jar:2.3.8.RELEASE:compile
[INFO] |  |  \- org.aspectj:aspectjweaver:jar:1.9.6:compile
[INFO] |  +- jakarta.transaction:jakarta.transaction-api:jar:1.3.3:compile
[INFO] |  +- jakarta.persistence:jakarta.persistence-api:jar:2.2.3:compile
[INFO] |  +- org.hibernate:hibernate-core:jar:5.4.27.Final:compile
[INFO] |  |  +- org.javassist:javassist:jar:3.27.0-GA:compile
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.10.19:compile
[INFO] |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  +- org.jboss:jandex:jar:2.1.3.Final:compile
[INFO] |  |  +- org.dom4j:dom4j:jar:2.1.3:compile
[INFO] |  |  +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.2.Final:compile
[INFO] |  |  \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.3:compile
[INFO] |  |     +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] |  |     +- org.glassfish.jaxb:txw2:jar:2.3.3:compile
[INFO] |  |     +- com.sun.istack:istack-commons-runtime:jar:3.0.11:compile
[INFO] |  |     \- com.sun.activation:jakarta.activation:jar:1.2.2:runtime
[INFO] |  +- org.springframework.data:spring-data-jpa:jar:2.3.6.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-orm:jar:5.2.12.RELEASE:compile
[INFO] |  \- org.springframework:spring-aspects:jar:5.2.12.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-amqp:jar:2.3.8.RELEASE:compile
[INFO] |  +- org.springframework:spring-messaging:jar:5.2.12.RELEASE:compile
[INFO] |  \- org.springframework.amqp:spring-rabbit:jar:2.2.14.RELEASE:compile
[INFO] |     +- com.rabbitmq:amqp-client:jar:5.9.0:compile
[INFO] |     \- org.springframework.amqp:spring-amqp:jar:2.2.14.RELEASE:compile
[INFO] |        \- org.springframework.retry:spring-retry:jar:1.2.5.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-redis:jar:2.3.8.RELEASE:compile
[INFO] |  +- org.springframework.data:spring-data-redis:jar:2.3.6.RELEASE:compile
[INFO] |  |  +- org.springframework.data:spring-data-keyvalue:jar:2.3.6.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-oxm:jar:5.2.12.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-context-support:jar:5.2.12.RELEASE:compile
[INFO] |  \- io.lettuce:lettuce-core:jar:5.3.6.RELEASE:compile
[INFO] |     +- io.netty:netty-common:jar:4.1.58.Final:compile
[INFO] |     +- io.netty:netty-handler:jar:4.1.58.Final:compile
[INFO] |     +- io.netty:netty-transport:jar:4.1.58.Final:compile
[INFO] |     \- io.projectreactor:reactor-core:jar:3.3.13.RELEASE:compile
[INFO] +- org.redisson:redisson-spring-boot-starter:jar:3.16.8:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-actuator:jar:2.3.8.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.3.8.RELEASE:compile
[INFO] |  |  |  \- org.springframework.boot:spring-boot-actuator:jar:2.3.8.RELEASE:compile
[INFO] |  |  \- io.micrometer:micrometer-core:jar:1.5.10:compile
[INFO] |  |     \- org.latencyutils:LatencyUtils:jar:2.0.3:runtime
[INFO] |  +- org.redisson:redisson:jar:3.16.8:compile
[INFO] |  |  +- io.netty:netty-codec:jar:4.1.58.Final:compile
[INFO] |  |  +- io.netty:netty-buffer:jar:4.1.58.Final:compile
[INFO] |  |  +- io.netty:netty-resolver:jar:4.1.58.Final:compile
[INFO] |  |  +- io.netty:netty-resolver-dns:jar:4.1.58.Final:compile
[INFO] |  |  |  \- io.netty:netty-codec-dns:jar:4.1.58.Final:compile
[INFO] |  |  +- javax.cache:cache-api:jar:1.1.1:compile
[INFO] |  |  +- org.reactivestreams:reactive-streams:jar:1.0.3:compile
[INFO] |  |  +- io.reactivex.rxjava3:rxjava:jar:3.0.12:compile
[INFO] |  |  +- org.jboss.marshalling:jboss-marshalling:jar:2.0.11.Final:compile
[INFO] |  |  +- org.jboss.marshalling:jboss-marshalling-river:jar:2.0.11.Final:compile
[INFO] |  |  \- org.jodd:jodd-bean:jar:5.1.6:compile
[INFO] |  |     \- org.jodd:jodd-core:jar:5.1.6:compile
[INFO] |  \- org.redisson:redisson-spring-data-25:jar:3.16.8:compile
[INFO] +- com.querydsl:querydsl-apt:jar:4.3.1:compile
[INFO] |  \- com.querydsl:querydsl-codegen:jar:4.3.1:compile
[INFO] |     +- com.mysema.codegen:codegen:jar:0.6.8:compile
[INFO] |     |  \- org.eclipse.jdt.core.compiler:ecj:jar:4.3.1:compile
[INFO] |     \- org.reflections:reflections:jar:0.9.9:compile
[INFO] |        \- com.google.code.findbugs:annotations:jar:2.0.1:compile
[INFO] +- com.querydsl:querydsl-jpa:jar:4.3.1:compile
[INFO] |  +- com.querydsl:querydsl-core:jar:4.3.1:compile
[INFO] |  |  +- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] |  |  +- com.mysema.commons:mysema-commons-lang:jar:0.2.4:compile
[INFO] |  |  \- com.infradna.tool:bridge-method-annotation:jar:1.13:compile
[INFO] |  +- javax.inject:javax.inject:jar:1:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.30:compile
[INFO] +- com.alibaba:fastjson:jar:1.2.4:compile
[INFO] +- com.github.xiaoymin:swagger-bootstrap-ui:jar:1.8.1:compile
[INFO] +- io.springfox:springfox-swagger2:jar:2.9.2:compile
[INFO] |  +- io.swagger:swagger-annotations:jar:1.5.20:compile
[INFO] |  +- io.swagger:swagger-models:jar:1.5.20:compile
[INFO] |  +- io.springfox:springfox-spi:jar:2.9.2:compile
[INFO] |  |  \- io.springfox:springfox-core:jar:2.9.2:compile
[INFO] |  +- io.springfox:springfox-schema:jar:2.9.2:compile
[INFO] |  +- io.springfox:springfox-swagger-common:jar:2.9.2:compile
[INFO] |  +- io.springfox:springfox-spring-web:jar:2.9.2:compile
[INFO] |  +- com.google.guava:guava:jar:20.0:compile
[INFO] |  +- com.fasterxml:classmate:jar:1.5.1:compile
[INFO] |  +- org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile
[INFO] |  +- org.springframework.plugin:spring-plugin-metadata:jar:1.2.0.RELEASE:compile
[INFO] |  \- org.mapstruct:mapstruct:jar:1.2.0.Final:compile
[INFO] +- mysql:mysql-connector-java:jar:8.0.30:runtime
[INFO] \- org.projectlombok:lombok:jar:1.18.16:compile (optional)

分析依赖树,可以看出在redisson的依赖中存在一个spring-boot-starter-actuator,很有可能是因为这个不兼容的actuator导致的问题,那么就在redisson依赖中排除它
在这里插入图片描述

重新导入maven后再次启动,可以正常启动了。

在这里插入图片描述
最后,版本升级一定要注意相关依赖之间的兼容和嵌套,对于不确定的去除version版本号采用继承方式,直接让maven去匹配合适版本。遇到冲突问题,及时检查依赖文件,mvn dependency: tree检查依赖树找出问题点。

  • 25
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

只吹45°风

一切随心,感激您的每一份支持。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值