栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

关于Correct the classpath of your application so that it contains a single, compatible versi

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

关于Correct the classpath of your application so that it contains a single, compatible versi

查看报错的内容,对应的模块,删除提示的包即可成功运行Eureka

或者改为Test

**

以上两种方法都只是暂时的,当重新引入pom文件依赖的时候又会重新报错,根本解决方法:

自己导入2.4版本的servlet-api

 
            javax.servlet
            servlet-api
            2.4
        

**
或者重新配置
配置Eureka的时候出错,出现Correct the classpath of your application so that it contains a single, compatible version of …
大致是

中出了问题

使用spring-boot-starter-parent

 
        org.springframework.boot
        spring-boot-starter-parent
        2.0.2.RELEASE
         
    

spring-boot-starter-parent里面 已经定义好了很多版本号,如果我们引入自己的parent里面的pom配置,jar包的版本号可能发生冲突。

然后再配置springboot和eurkea
springboot2.0以下的用 spring-cloud-starter-eureka-server
2.0以上的用spring-cloud-starter-netflix-eureka-server
总配置:




    4.0.0
    
        org.springframework.boot
        spring-boot-starter-parent
        2.0.2.RELEASE
         
    

    
        UTF-8
        UTF-8
        1.8
        Finchley.RC2
    

    springcloud-erueka-7001

    

        
            org.springframework.cloud
            spring-cloud-starter-netflix-eureka-server
            2.0.2.RELEASE
        

        
            org.springframework.boot
            spring-boot-starter-test
            test
        
        
            org.springframework.boot
            spring-boot-autoconfigure
        






即可运行成功Eureka

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/397461.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号