Error creating bean with name ‘jmxMBeanExporter‘ in resource JmxEndpointAutoConfiguration问题解决办法

一、错误日志

org.springframework.beans.factory.BeanCreationException: Error creating 
bean with name 'jmxMBeanExporter' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/jmx/
JmxEndpointAutoConfiguration.class]: Bean instantiation via factory method failed; 
nested exception is org.springframework.beans.BeanInstantiationException: 
Failed to instantiate [org.springframework.boot.actuate.endpoint.jmx.JmxEndpointExporter]: 
Factory method 'jmxMBeanExporter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating 
bean with name 'serviceRegistryEndpoint' defined in class path resource [org/springframework/cloud/client/
serviceregistry/ServiceRegistryAutoConfiguration$ServiceRegistryEndpointConfiguration.class]: 
Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException: 
Failed to introspect Class [org.springframework.cloud.client.serviceregistry.endpoint.ServiceRegistryEndpoint] 
from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]

二、解决办法

2.1.修改pom文件

增加这个依赖引入:

<!-- SpringBoot Web -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

2.2.增加pom文件无效

        这个报错其实就是没有找到要加载的类,一般在启动的时候报错。
        加载不到的类有两种情况,一种是直接找不到要加载的依赖包,或者添加了依赖包后没有加载进入,需要看看是不是 maven 的设置问题,重新刷新加载一下 maven 的依赖,或者清一下 idea 的缓存;另外一种是导入了依赖包,但是依赖包中又引入了其他的依赖包中的类,这个类找不到。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值