Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide metrics fallback if ThreadLocalRandom fails #690

Closed
philwebb opened this issue Apr 18, 2014 · 8 comments
Closed

Provide metrics fallback if ThreadLocalRandom fails #690

philwebb opened this issue Apr 18, 2014 · 8 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@philwebb
Copy link
Member

https://twitter.com/chanezon/status/456900551880757248
https://twitter.com/chanezon/status/456900551880757248

Metrics uses java.util.concurrent.ThreadLocalRandom.initialSeed which in turn uses java.net.NetworkInterface.getNetworkInterfaces. This can fail on some PaaS setups so we might want to look at some kind of fallback.

@dsyer
Copy link
Member

dsyer commented Apr 18, 2014

You could use this: https://github.com/scratches/spring-boot-legacy/blob/master/src/main/java/org/springframework/boot/legacy/context/web/MetricFilterAutoConfiguration.java. That was created for Java 1.6 apps, so it can't possibly be using ThreadLocalRandom.

@chanezon
Copy link

Where do you specify you want to use it?

@dsyer
Copy link
Member

dsyer commented Apr 18, 2014

The "legacy" version was specifically designed to work in Java 1.6. If you use 1.6 it only has to be on the classpath. If not you would have to explicitly exclude the default MetricFilterAutoConfiguration as well.

@chanezon
Copy link

Thanks!

@dsyer
Copy link
Member

dsyer commented Apr 19, 2014

I can't find any references to ThreadLocalRandom in Spring Boot. Can you get a stack trace or something?

@chanezon
Copy link

Here's the StackTrace
It's coming from java.util.concurrent.ConcurrentSkipListMap
used in org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository

2014-04-17 20:43:09.524  INFO 12368 --- [nio-8447-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization completed in 235 ms
Exception in thread "metricsExecutor-1" java.lang.Error: IP Helper Library GetIfTable function failed
    at java.net.NetworkInterface.getAll(Native Method)
    at java.net.NetworkInterface.getNetworkInterfaces(NetworkInterface.java:343)
    at java.util.concurrent.ThreadLocalRandom.initialSeed(ThreadLocalRandom.java:153)
    at java.util.concurrent.ThreadLocalRandom.<clinit>(ThreadLocalRandom.java:137)
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.set(SimpleInMemoryRepository.java:66)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.set(InMemoryMetricRepository.java:70)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.set(CompositeMetricWriter.java:54)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:47)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-2" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.update(SimpleInMemoryRepository.java:54)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.increment(InMemoryMetricRepository.java:53)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.increment(CompositeMetricWriter.java:47)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:43)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-3" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.set(SimpleInMemoryRepository.java:66)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.set(InMemoryMetricRepository.java:70)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.set(CompositeMetricWriter.java:54)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:47)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-4" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.update(SimpleInMemoryRepository.java:54)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.increment(InMemoryMetricRepository.java:53)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.increment(CompositeMetricWriter.java:47)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:43)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-6" Exception in thread "metricsExecutor-5" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.update(SimpleInMemoryRepository.java:54)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.increment(InMemoryMetricRepository.java:53)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.increment(CompositeMetricWriter.java:47)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:43)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.set(SimpleInMemoryRepository.java:66)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.set(InMemoryMetricRepository.java:70)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.set(CompositeMetricWriter.java:54)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:47)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-7" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.set(SimpleInMemoryRepository.java:66)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.set(InMemoryMetricRepository.java:70)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.set(CompositeMetricWriter.java:54)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:47)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-10" Exception in thread "metricsExecutor-9" Exception in thread "metricsExecutor-8" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.set(SimpleInMemoryRepository.java:66)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.set(InMemoryMetricRepository.java:70)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.set(CompositeMetricWriter.java:54)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:47)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.update(SimpleInMemoryRepository.java:54)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.increment(InMemoryMetricRepository.java:53)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.increment(CompositeMetricWriter.java:47)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:43)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.update(SimpleInMemoryRepository.java:54)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.increment(InMemoryMetricRepository.java:53)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.increment(CompositeMetricWriter.java:47)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:43)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-11" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.set(SimpleInMemoryRepository.java:66)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.set(InMemoryMetricRepository.java:70)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.set(CompositeMetricWriter.java:54)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:47)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-12" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.update(SimpleInMemoryRepository.java:54)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.increment(InMemoryMetricRepository.java:53)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.increment(CompositeMetricWriter.java:47)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:43)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-13" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.set(SimpleInMemoryRepository.java:66)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.set(InMemoryMetricRepository.java:70)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.set(CompositeMetricWriter.java:54)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:47)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-14" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.update(SimpleInMemoryRepository.java:54)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.increment(InMemoryMetricRepository.java:53)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.increment(CompositeMetricWriter.java:47)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:43)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-15" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.set(SimpleInMemoryRepository.java:66)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.set(InMemoryMetricRepository.java:70)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.set(CompositeMetricWriter.java:54)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:47)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-16" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.update(SimpleInMemoryRepository.java:54)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.increment(InMemoryMetricRepository.java:53)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.increment(CompositeMetricWriter.java:47)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:43)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-22" Exception in thread "metricsExecutor-21" Exception in thread "metricsExecutor-20" Exception in thread "metricsExecutor-19" Exception in thread "metricsExecutor-18" Exception in thread "metricsExecutor-17" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.set(SimpleInMemoryRepository.java:66)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.set(InMemoryMetricRepository.java:70)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.set(CompositeMetricWriter.java:54)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:47)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.update(SimpleInMemoryRepository.java:54)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.increment(InMemoryMetricRepository.java:53)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.increment(CompositeMetricWriter.java:47)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:43)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.update(SimpleInMemoryRepository.java:54)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.increment(InMemoryMetricRepository.java:53)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.increment(CompositeMetricWriter.java:47)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:43)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.set(SimpleInMemoryRepository.java:66)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.set(InMemoryMetricRepository.java:70)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.set(CompositeMetricWriter.java:54)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:47)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.update(SimpleInMemoryRepository.java:54)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.increment(InMemoryMetricRepository.java:53)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.increment(CompositeMetricWriter.java:47)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:43)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.set(SimpleInMemoryRepository.java:66)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.set(InMemoryMetricRepository.java:70)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.set(CompositeMetricWriter.java:54)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:47)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-23" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.set(SimpleInMemoryRepository.java:66)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.set(InMemoryMetricRepository.java:70)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.set(CompositeMetricWriter.java:54)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:47)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-24" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.update(SimpleInMemoryRepository.java:54)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.increment(InMemoryMetricRepository.java:53)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.increment(CompositeMetricWriter.java:47)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:43)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Exception in thread "metricsExecutor-25" Exception in thread "metricsExecutor-26" java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.set(SimpleInMemoryRepository.java:66)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.set(InMemoryMetricRepository.java:70)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.set(CompositeMetricWriter.java:54)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:47)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom
    at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
    at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1962)
    at org.springframework.boot.actuate.metrics.util.SimpleInMemoryRepository.update(SimpleInMemoryRepository.java:54)
    at org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository.increment(InMemoryMetricRepository.java:53)
    at org.springframework.boot.actuate.metrics.writer.CompositeMetricWriter.increment(CompositeMetricWriter.java:47)
    at org.springframework.boot.actuate.metrics.writer.MetricWriterMessageHandler.handleMessage(MetricWriterMessageHandler.java:43)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)

@dsyer
Copy link
Member

dsyer commented Apr 20, 2014

That looks like a bug in your JDK (maybe caused by a security constraint?): ConcurrentSkipListMap can't find a class it needs. What version of the JDK is it? Did you build it yourself, or just install a bad-ass security manager? The source code in my ConcurrentSkipListMap says it is "since 1.6" and ThreadLocalRandom is "since 1.7", but if you get the JDK from a proper source they should always be consistent. So putting it together with the previous comment about ThreadLocalRandom.initialSeed, maybe you need to get the security constraint lifted so that the JDK can access its own library classes?

@dsyer
Copy link
Member

dsyer commented Jun 10, 2014

Is this issue dead?

@dsyer dsyer closed this as completed Jun 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants