使用 SpringCloud 的 Hystrix 熔断器时报出如下错误:
Servlet.service() for servlet [dispatcherServlet] in context with path [/showConsumer] threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/HdrHistogram/Histogram] with root cause
java.lang.ClassNotFoundException: org.HdrHistogram.Histogram
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at com.netflix.hystrix.metric.CachedValuesHistogram.getNewHistogram(CachedValuesHistogram.java:148)
at com.netflix.hystrix.metric.consumer.RollingDistributionStream.<init>(RollingDistributionStream.java:49)
at com.netflix.hystrix.metric.consumer.RollingCommandLatencyDistributionStream.<init>(RollingCommandLatencyDistributionStream.java:93)
at com.netflix.hystrix.metric.consumer.RollingCommandLatencyDistributionStream.getInstance(RollingCommandLatencyDistributionStream.java:78)
at com.netflix.hystrix.metric.consumer.RollingCommandLatencyDistributionStream.getInstance(RollingCommandLatencyDistributionStream.java:67)
at com.netflix.hystrix.HystrixCommandMetrics.<init>(HystrixCommandMetrics.java:196)
at com.netflix.hystrix.HystrixCommandMetrics.getInstance(HystrixCommandMetrics.java:134)
at com.netflix.hystrix.AbstractCommand.initMetrics(AbstractCommand.java:240)
at com.netflix.hystrix.AbstractCommand.<init>(AbstractCommand.java:166)
at com.netflix.hystrix.HystrixCommand.<init>(HystrixCommand.java:148)
at com.netflix.hystrix.HystrixCommand.<init>(HystrixCommand.java:134)
at com.netflix.hystrix.contrib.javanica.command.AbstractHystrixCommand.<init>(AbstractHystrixCommand.java:51)
at com.netflix.hystrix.contrib.javanica.command.GenericCommand.<init>(GenericCommand.java:36)
at com.netflix.hystrix.contrib.javanica.command.HystrixCommandFactory.create(HystrixCommandFactory.java:43)
at com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect.methodsAnnotatedWithHystrixCommand(HystrixCommandAspect.java:94)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorIm