elonazoulay commented on a change in pull request #6424:
URL: https://github.com/apache/incubator-pinot/pull/6424#discussion_r622113087
##########
File path:
pinot-spi/src/main/java/org/apache/pinot/spi/plugin/PluginClassLoader.java
##########
@@ -36,18 +36,9 @@
public PluginClassLoader(URL[] urls, ClassLoader parent) {
super(urls, parent);
classLoader = PluginClassLoader.class.getClassLoader();
- Method method = null;
- try {
- method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
-
- } catch (NoSuchMethodException e) {
- //this should never happen
- ExceptionUtils.rethrow(e);
- }
- method.setAccessible(true);
for (URL url : urls) {
try {
- method.invoke(classLoader, url);
+ super.add(url);
Review comment:
Update: In java9+ the application class loader no longer extends
URIClassLoader:
https://community.oracle.com/tech/developers/discussion/4011800/base-classloader-no-longer-from-urlclassloader
Invoking addURL will work for all jdk versions. In the findClass method, if
the class is not in the parent class loader it will be in this one. I added a
comment to explain.
Also, this has been working for us in production.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]