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

java.lang.ClassNotFoundException: jdk.internal.misc.Unsafe #6855

Closed
ashkanpaya88 opened this issue Jun 13, 2017 · 2 comments
Closed

java.lang.ClassNotFoundException: jdk.internal.misc.Unsafe #6855

ashkanpaya88 opened this issue Jun 13, 2017 · 2 comments
Assignees
Milestone

Comments

@ashkanpaya88
Copy link

Expected behavior: No stack trace regarding this class

Actual behavior:

D 06-06 11:01:33.811 pool-1-thread-2 i.n.u.i.l.InternalLoggerFactory:71 |::] Using SLF4J as the default logging framework
D 06-06 11:01:33.819 pool-1-thread-2 i.n.u.i.PlatformDependent0:76 |::] -Dio.netty.noUnsafe: false
D 06-06 11:01:33.823 pool-1-thread-2 i.n.u.i.PlatformDependent0:71 |::] sun.misc.Unsafe.theUnsafe: available
D 06-06 11:01:33.824 pool-1-thread-2 i.n.u.i.PlatformDependent0:71 |::] sun.misc.Unsafe.copyMemory: available
D 06-06 11:01:33.825 pool-1-thread-2 i.n.u.i.PlatformDependent0:71 |::] java.nio.Buffer.address: available
D 06-06 11:01:33.826 pool-1-thread-2 i.n.u.i.PlatformDependent0:71 |::] direct buffer constructor: available
D 06-06 11:01:33.828 pool-1-thread-2 i.n.u.i.PlatformDependent0:76 |::] java.nio.Bits.unaligned: available, true
D 06-06 11:01:33.834 pool-1-thread-2 i.n.u.i.PlatformDependent0:91 |::] jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable
java.lang.ClassNotFoundException: jdk.internal.misc.Unsafe
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at io.netty.util.internal.PlatformDependent0$6.run(PlatformDependent0.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:288)
	at io.netty.util.internal.PlatformDependent.getSystemClassLoader(PlatformDependent.java:895)
	at io.netty.util.internal.PlatformDependent.isAndroid0(PlatformDependent.java:919)
	at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:70)
	at io.netty.util.ConstantPool.<init>(ConstantPool.java:32)
	at io.netty.util.AttributeKey$1.<init>(AttributeKey.java:27)
	at io.netty.util.AttributeKey.<clinit>(AttributeKey.java:27)
....
	at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
	at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
	at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:84)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
	at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
	at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:75)
	at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:73)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
	at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:73)
	at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:60)
	at com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:944)
....
	at org.junit.rules.RunRules.applyAll(RunRules.java:26)
	at org.junit.rules.RunRules.<init>(RunRules.java:15)
	at org.junit.runners.BlockJUnit4ClassRunner.withTestRules(BlockJUnit4ClassRunner.java:400)
	at org.junit.runners.BlockJUnit4ClassRunner.withRules(BlockJUnit4ClassRunner.java:356)
	at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:278)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:393)
	at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54)
	at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:352)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:27)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:393)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	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:745)
D 06-06 11:01:33.835 pool-1-thread-2 i.n.u.i.PlatformDependent0:76 |::] java.nio.DirectByteBuffer.<init>(long, int): available
D 06-06 11:01:33.836 pool-1-thread-2 i.n.u.i.PlatformDependent:76 |::] Java version: 8
D 06-06 11:01:33.836 pool-1-thread-2 i.n.u.i.PlatformDependent:76 |::] sun.misc.Unsafe: available
D 06-06 11:01:33.837 pool-1-thread-2 i.n.u.i.PlatformDependent:76 |::] -Dio.netty.tmpdir: /var/folders/nx/jmr5yqhx6ksgz00ftry92g0rqp6l0q/T (java.io.tmpdir)
D 06-06 11:01:33.838 pool-1-thread-2 i.n.u.i.PlatformDependent:76 |::] -Dio.netty.bitMode: 64 (sun.arch.data.model)
D 06-06 11:01:33.840 pool-1-thread-2 i.n.u.i.PlatformDependent:76 |::] -Dio.netty.noPreferDirect: false
D 06-06 11:01:33.841 pool-1-thread-2 i.n.u.i.PlatformDependent:76 |::] -Dio.netty.maxDirectMemory: 954728448 bytes
D 06-06 11:01:33.841 pool-1-thread-2 i.n.u.i.PlatformDependent:76 |::] -Dio.netty.uninitializedArrayAllocationThreshold: -1
D 06-06 11:01:33.842 pool-1-thread-2 i.n.util.internal.CleanerJava6:71 |::] java.nio.ByteBuffer.cleaner(): available

Steps to reproduce

We were using netty 4.0.x branch for long time and once we switch to 4.1.x, this stack trace appeared.

Netty version: 4.1.11.Final

Netty tcnative version: 2.0.1.Final

JVM version (e.g. java -version)

openjdk version "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)

OS version (e.g. uname -a)

Ubuntu 16.04 and Mac 10.11.4

@normanmaurer
Copy link
Member

@ashkanpaya88 ah this was fixed recently and is harmless:
0ee49e6

Upgrade to 4.1.12.Final and you will not see it anymore

@normanmaurer normanmaurer self-assigned this Jun 14, 2017
@normanmaurer normanmaurer added this to the 4.1.12.Final milestone Jun 14, 2017
@ashkanpaya88
Copy link
Author

Great, thank you!

jimrthy added a commit to jimrthy/frereth-cp that referenced this issue Feb 1, 2018
At least it got rid of the annoying startup error that involved a
ClassNotFoundException and jdk.internal.misc.Unsafe.

c.f. netty/netty#6855.

This looked like it was at least in the general vicinity of the core
dump that's coming from trying to build-actual-hello-packet.

As predicted in that ticket, this really didn't help my actual
problem. But it's been something for which I've been itching to find an
excuse for quite a while now.

No idea whether anything else got broken in the process.
quaxt added a commit to quaxt/fulstk that referenced this issue Apr 11, 2020
yada was pulling in an old version of aleph which in turn was pulling
in an old version of Netty (4.1.11), which had this issue

netty/netty#6855
java.lang.ClassNotFoundException: jdk.internal.misc.Unsafe

That exception would appear when running the production Uberjar

Updating aleph to 0.4.6, we get netty 4.1.25 (issue was fixed in 4.1.12)
quaxt added a commit to quaxt/fulstk that referenced this issue Apr 11, 2020
yada was pulling in an old version of aleph which in turn was pulling
in an old version of Netty (4.1.11), which had this issue

netty/netty#6855
java.lang.ClassNotFoundException: jdk.internal.misc.Unsafe

That exception would appear when running the production Uberjar

Updating aleph to 0.4.6, we get netty 4.1.25 (issue was fixed in 4.1.12)
myunghoonju added a commit to myunghoonju/myboot that referenced this issue May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants