环境:intellij idea 2018.1.8 + jdk1.8 + spring boot 2.2.0.RELEASE

参考:https://www.cnblogs.com/grasp/p/9258811.html(侵删)

我们使用idea自动生成,最终在运行eureka client的时候会报错:

java.lang.NoClassDefFoundError: org/springframework/boot/actuate/health/HealthAggregatorat java.lang.Class.getDeclaredConstructors0(Native Method) ~[na:1.8.0_171]at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) ~[na:1.8.0_171]at java.lang.Class.getDeclaredConstructors(Class.java:2020) ~[na:1.8.0_171]at org.springframework.boot.context.properties.ConfigurationPropertiesBean$BindMethod.findBindConstructor(ConfigurationPropertiesBean.java:318) ~[spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]at org.springframework.boot.context.properties.ConfigurationPropertiesBean$BindMethod.forClass(ConfigurationPropertiesBean.java:300) ~[spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]at org.springframework.boot.context.properties.ConfigurationPropertiesBeanDefinitionValidator.validate(ConfigurationPropertiesBeanDefinitionValidator.java:57) ~[spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]at org.springframework.boot.context.properties.ConfigurationPropertiesBeanDefinitionValidator.postProcessBeanFactory(ConfigurationPropertiesBeanDefinitionValidator.java:45) ~[spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:286) ~[spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:174) ~[spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706) ~[spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.0.RELEASE.jar:2.2.0.RELEASE]at com.czc.eurekaclient.EurekaClientApplication.main(EurekaClientApplication.java:12) [classes/:na]
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.health.HealthAggregatorat java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_171]at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_171]at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[na:1.8.0_171]at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_171]... 18 common frames omitted

也就是找不到HealthAggregator这个类。

解决:

在eureka-client模块的pom.xml中加入依赖:

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

SpringCloud_Eureka:java.lang.NoClassDefFoundError: org/springframework/boot/actuate/health/HealthAgg相关推荐

  1. Caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.health.OrderedHealthAg

    依赖添加 <dependency><groupId>org.springframework.boot</groupId><artifactId>spri ...

  2. java.lang.ClassNotFoundException org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEnd

    spring cloud alibaba dubbo集成出现 java.lang.ClassNotFoundException: org.springframework.boot.actuate.au ...

  3. 出现 **caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.autoconfigure.en

    出现 caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.autoconfigure.endpo ...

  4. java.lang.NoClassDefFoundError: org/springframework/boot/context/embedded/FilterRegistrationBean

    java.lang.NoClassDefFoundError: org/springframework/boot/context/embedded/FilterRegistrationBean 昨天还 ...

  5. jrebel java.lang.ClassCastException: org.springframework.boot.actuate.endpoint.annotation

    在看开源项目 xxl-job 时,使用jrebel启动报错: Caused by: java.lang.ClassCastException: org.springframework.boot.act ...

  6. 异常解决java.lang.ClassNotFoundException: org.springframework.boot.actuate.endpoint.PublicMetrics

    异常java.lang.ClassNotFoundException: org.springframework.boot.actuate.endpoint.PublicMetrics 原因:sprin ...

  7. BUG修改:java.lang.NoClassDefFoundError: org/springframework/boot/Bootstrapper

    在使用springcloud的报错 错误信息 原因 做法 反思 错误信息 21:11:55.834 [main] ERROR org.springframework.boot.SpringApplic ...

  8. java.lang.ClassNotFoundException: org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEnd

    https://blog.csdn.net/lixiangfei4/article/details/103911293

  9. NoClassDefFoundError: org/springframework/boot/actuate/web/trace/servlet/HttpTraceFilter

    线上项目运行期间报错:java.lang.NoClassDefFoundError: org/springframework/boot/actuate/web/trace/servlet/HttpTr ...

最新文章

  1. Linux nohup和的功效
  2. STM32之Systick(系统时钟滴答定时器)
  3. MFC关键技术-消息映射机制
  4. 防护疫情防御插画|后疫情时代宣传不可小觑
  5. (转载)使用 Anthem.NET 的常见回调(Callback)处理方式小结
  6. 深度探索QT窗口系统——几何篇
  7. 战地一的服务器在哪个文件夹,战地1怎么加入服务器 战地1加入服务器方法
  8. python函数变量教程_Python 函数变量
  9. 新手使用PS心得-技巧
  10. 人工智能之Python人脸对比、人脸检测
  11. TextMeshPro 制作表情包流程
  12. Homekit智能家居DIY之智能灯泡
  13. JavaScript编程技术基础
  14. C++学习之路——Chapter 2:开始学习C++
  15. 35搜索插入位置之Leecode—《数组篇》(二分法)
  16. 17弹出窗体-03GIF录屏-gifwidget
  17. 如何在服务器上挂载固态硬盘
  18. 计算机应用能力考试多少选择题,计算机应用能力考试选择题汇总.doc
  19. 怎么把计算机中更改你的视图,如何修改电脑中文件或文件夹显示的详细信息选项...
  20. git tag 操作

热门文章

  1. C语言中矩阵定义问题
  2. JS addEventListener()方法
  3. Java 微服务架构
  4. Sql Server服务远程过程调用失败
  5. linux的关机重启命令汇总
  6. LINUX磁盘分区挂载笔记
  7. 初识C++之智能指针
  8. JSP房地产门户管理系统myeclipse开发mysql数据库BS模式java编程网页结构详细设计
  9. STM32F103最小系统原理图
  10. 一篇文章带你深入理解漏洞之 XXE 漏洞