Creating of LinkedTransferQueue may fail because of ClassLoader #268

Closed
normanmaurer opened this Issue Apr 17, 2012 · 6 comments

2 participants

@normanmaurer
The Netty Project member

If you run netty in an applicationserver it may happen that we detect com.sun.Unsafe on the start but are not allowed to use it later. So we see something like this:

java.lang.NoClassDefFoundError: Could not initialize class org.jboss.netty.util.internal.LinkedTransferQueue

We should just catch it and use the LegacyLinkedTransferQueue in such cases as a fallback

@normanmaurer normanmaurer was assigned Apr 17, 2012
@normanmaurer
The Netty Project member

The same issue may also effect OSGI deployments

@yetanothercoder

caught this issue when running an osgi app from IDEA with felix container (ClassNotFoundException: sun.misc.Unsafe not found by org.jboss.netty)

After checking the netty sources, found the workaround: -Dorg.jboss.netty.tryUnsafe=false (to IDEA launch configuration)

@normanmaurer
The Netty Project member

@yetanothercoder which version ?

@normanmaurer
The Netty Project member

@yetanothercoder ok but it should still work even without set the property as it failback to non unsafe use. See also the log message. Anyway setting the property can't harm I guess :)

@yetanothercoder

should, it may be an IDEA issue only, will check on other environments this week, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment