Guard against NoClassDefFoundError when trying to load Unsafe.
Motivation: OSGI and other enviroments may not allow to even load Unsafe which will lead to an NoClassDefFoundError when trying to access it. We should guard against this. Modifications: Catch NoClassDefFoundError when trying to load Unsafe. Result: Be able to use netty with a strict OSGI config.
This commit is contained in:
parent
f9cadc0a8c
commit
65cacc9b15
@ -96,6 +96,10 @@ final class PlatformDependent0 {
|
|||||||
return e;
|
return e;
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
return e;
|
return e;
|
||||||
|
} catch (NoClassDefFoundError e) {
|
||||||
|
// Also catch NoClassDefFoundError in case someone uses for example OSGI and it made
|
||||||
|
// Unsafe unloadable.
|
||||||
|
return e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user