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

Fixes #4304: ResourceConfig not properly using specified ClassLoader #4305

Closed
wants to merge 2 commits into from
Closed

Fixes #4304: ResourceConfig not properly using specified ClassLoader #4305

wants to merge 2 commits into from

Conversation

d0x7
Copy link
Contributor

@d0x7 d0x7 commented Oct 28, 2019

This PR fixes the problem (eventually a bug?) in the issue #4304.

Please review, tell me what to change and then eventually merge the PR.
If you won't merge it, I'd like to know why, because I don't wanna maintain my own fork.

// Workaround because otherwise classes from a different classloader can't be loaded
if (resourceFinder instanceof PackageNamesScanner) {
final ClassLoader classLoader = ((PackageNamesScanner) resourceFinder).getClassloader();
afl = AnnotationAcceptingListener.newJaxrsResourceAndProviderListener(classLoader);
Copy link
Contributor

@jansupol jansupol Oct 29, 2019

Choose a reason for hiding this comment

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

Do not do this when the default ClassLoader:

if (!getClassLoader().equals(classLoader)) {
   afl = AnnotationAcceptingListener.newJaxrsResourceAndProviderListener(classLoader);
}

@@ -896,10 +927,11 @@ public boolean isRegistered(final Class<?> componentClass) {
}
}
}

result.addAll(afl.getAnnotatedClasses());
Copy link
Contributor

Choose a reason for hiding this comment

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

if (parentAfl != afl)

}
}

result.addAll(afl.getAnnotatedClasses());
Copy link
Contributor

Choose a reason for hiding this comment

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

+result.addAll(parentAfl.getAnnotatedClasses());

@jansupol
Copy link
Contributor

See Wiki

@d0x7
Copy link
Contributor Author

d0x7 commented Oct 29, 2019

See Wiki

Apparently I forgot to add the "Signed off by: *" to the commit. According to the wiki, it needs to be included to every commit I made. What should I do now, because the two commits don't have it, even tho it's signed?

EDIT: I guess the easiest would be deleting my fork, doing the changes again but signed off this time and then creating a new PR?

@d0x7
Copy link
Contributor Author

d0x7 commented Oct 29, 2019

See #4306, sorry again.

@d0x7 d0x7 closed this Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants