Different ClassLoaders + Gradle dependencies

Hello, I have a problem with loading class from my Gradle dependency. 
How I understand. There are I have 2 different ClassLoaders (in my plugin):
1. Context ClassLoader -> Thread.currentThread().getContextClassLoader(): com.intellij.util.lang.UrlClassLoader.
method getUrls() returns urls: JRE/lib/... + my Intellij project libs (in my case - Rider/lib/...).

2. com.intellij.ide.plugins.cl.PluginClassLoader extends com.intellij.util.lang.UrlClassLoader
method getUrls() returns my Gradle dependencies urls.

PluginClassLoader can see urls from UrlClassLoader, but I have third-party class javax.xml.ws.spi.FactoryFinder, that 
calls Thread.currentThread().getContextClassLoader() and gets UrlClassLoader. Then I need to load class javax.xml.ws.spi.ProviderImpl 
from Gradle dependency, but UrlClassLoader knows nothing about it.

 

4 comments
Comment actions Permalink

Were you able to resolve this? I have similar problem

0
Comment actions Permalink

I also have this problem. How do I get the right class loader to load from my dependencies?

0
Comment actions Permalink

I hit this problem when I am trying to apply jaxws files for my plugin.

Can someone know how to fix it or is there a workaround to solve this? 

 

0
Comment actions Permalink

Any one had luck with this?

0

Please sign in to leave a comment.