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

PlatformDependent#getClassLoader fails in restrictive classloader env… #6251

Closed
wants to merge 1 commit into from

Conversation

Scottmitch
Copy link
Member

…ironment

Motivation:
#6042 only addressed PlatformDependent#getSystemClassLoader but getClassLoader is also called in an optional manner in some common code paths but fails to catch a general enough exception to continue working.

Modifications:

  • Calls to getClassLoader which can continue if results fail should catch Throwable

Result:
More resilient code in the presense of restrictive class loaders.
Fixes #6246.

@Scottmitch Scottmitch added this to the 4.1.8.Final milestone Jan 19, 2017
@Scottmitch Scottmitch self-assigned this Jan 19, 2017
@Scottmitch
Copy link
Member Author

@jesperpedersen - please verify this fix. Also I'm not sure why you get NoClassDefFoundError in the first place. You mentioned in #6038 (comment) WildFly is using an isolated classloader environment based on JBoss Modules. ... any ideas why PlatformDependent0 would no be loaded?

} catch (ClassNotFoundException e) {
// This should not happen just ignore
} catch (Throwable cause) {
logger.debug("Unexpected exception", cause);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Scottmitch can you use some better logging message ?

Maybe something like Unexpected exception while loading class {}, class, cause)`

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@normanmaurer
Copy link
Member

@Scottmitch one nit...

@jesperpedersen
Copy link

This works, with the following log message:

08:57:10,909 WARNING [io.netty.channel.DefaultChannelId] (management-handler-thread - 3) Failed to find the current process ID from ''; using a random value: 970346034

@Scottmitch
Copy link
Member Author

@jesperpedersen - Thanks for verifying. That warning makes sense ... as I said I'm still not sure why the class loading would fail in your environment.

…ironment

Motivation:
netty#6042 only addressed PlatformDependent#getSystemClassLoader but getClassLoader is also called in an optional manner in some common code paths but fails to catch a general enough exception to continue working.

Modifications:
- Calls to getClassLoader which can continue if results fail should catch Throwable

Result:
More resilient code in the presense of restrictive class loaders.
Fixes netty#6246.
@Scottmitch
Copy link
Member Author

4.1 (9a4aa61) 4.0 (7528f11)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants