ClassNotFoundException: com.alibaba.csp.sentinel.log.Logger

com.alibaba.csp.sentinel.log.Logger 类没找到

sentinel-core-1.7.1 以下 缺少 com.alibaba.csp.sentinel.log.Logger 接口

异常依赖

<!--            sentinel依赖-->
<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
    <version>2.2.1.RELEASE</version>
</dependency>
<!--            sentinel依赖-->

2.2.1.RELEASE 中,sentinel-core 的版本为 1.7.1,需要升级版本

将 版本改为以下即可:

<!--            sentinel依赖-->
<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
    <version>2.2.4.RELEASE</version>
</dependency>
<!--            sentinel依赖-->

2.2.4.RELEASE 中,sentinel-core 默认版本为:1.8.0

异常信息如下

Error: failed to initialize Sentinel CommandCenterLog
java.lang.NoClassDefFoundError: com/alibaba/csp/sentinel/log/LoggerSpiProvider
	at com.alibaba.csp.sentinel.transport.log.CommandCenterLog.<clinit>(CommandCenterLog.java:36)
	at com.alibaba.csp.sentinel.transport.command.SimpleHttpCommandCenter$2.run(SimpleHttpCommandCenter.java:104)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.alibaba.csp.sentinel.log.LoggerSpiProvider
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 3 more
Exception in thread "Thread-39" java.lang.NoClassDefFoundError: com/alibaba/csp/sentinel/log/Logger
	at com.alibaba.csp.sentinel.transport.log.CommandCenterLog.info(CommandCenterLog.java:48)
	at com.alibaba.csp.sentinel.transport.command.SimpleHttpCommandCenter$2.run(SimpleHttpCommandCenter.java:104)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.alibaba.csp.sentinel.log.Logger
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 3 more

你可能感兴趣的:(学习所遇问题记录)