亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

無法啟動 springboot-admin:java.lang.NoClassDefr:

無法啟動 springboot-admin:java.lang.NoClassDefr:

江戶川亂折騰 2023-10-13 14:39:40
當我嘗試啟動 springboot-admin 時,它拋出: java.lang.NoClassDefFoundError: org/springframework/cloud/netflix/zuul/ZuulServerAutoConfiguration 這是我的版本沖突嗎?SpringBoot版本:2.1.9.RELEASESpringCloud版本:Greenwich.SR3SpringBootAdmin版本:2.1.5我的主類代碼:@Configuration@EnableAutoConfiguration@EnableAdminServer@EnableDiscoveryClientpublic class SpringbootAdminApplication {    public static void main(String[] args) {        SpringApplication.run(SpringbootAdminApplication.class, args);    }}我的maven代碼: <parent>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-starter-parent</artifactId>        <version>2.1.9.RELEASE</version>        <relativePath/> <!-- lookup parent from repository -->    </parent><!-- It's partly dependent--><dependency>            <groupId>de.codecentric</groupId>            <artifactId>spring-boot-admin-starter-server</artifactId>            <version>2.1.5</version>        </dependency> <dependency>            <groupId>org.springframework.boot</groupId>            <artifactId>spring-boot-starter</artifactId>        </dependency> <dependency>            <groupId>org.springframework.boot</groupId>            <artifactId>spring-boot-starter-web</artifactId>        </dependency>        <dependency>            <groupId>org.springframework.cloud</groupId>            <artifactId>spring-cloud-starter-eureka</artifactId>        </dependency> <dependency>                <groupId>org.springframework.cloud</groupId>                <artifactId>spring-cloud-dependencies</artifactId>                <version>Greenwich.SR3</version>                <type>pom</type>                <scope>import</scope>            </dependency>我的配置文件:spring:  application:    name: spring-boot-admineureka:  client:    service-url:      defaultZone: http://localhost:8010/eurekaserver:  port: 8083我想啟動應用程序
查看完整描述

1 回答

?
弒天下

TA貢獻1818條經驗 獲得超8個贊

將 spring-cloud 依賴項移到 dependencyManagement 標簽下,然后嘗試,


<dependencyManagement>

        <dependencies>

            <dependency>

                <groupId>org.springframework.cloud</groupId>

                <artifactId>spring-cloud-dependencies</artifactId>

                <version>Greenwich.SR3</version>

                <type>pom</type>

                <scope>import</scope>

            </dependency>

        </dependencies>

    </dependencyManagement>


查看完整回答
反對 回復 2023-10-13
  • 1 回答
  • 0 關注
  • 124 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號