You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Jersey is loaded via custom classloader it's failing with ClassNotFoundException:
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / Caused by :java.lang.ClassNotFoundException: org.glassfish.jersey.internal.spi.AutoDiscoverable
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:335)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:302)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:180)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at java.lang.ClassLoader.defineClass1(Native Method)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:385)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:344)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:302)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:180)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at weblogic.utils.classloaders.FilteringClassLoader.findClass(FilteringClassLoader.java:106)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at weblogic.utils.classloaders.FilteringClassLoader.loadClass(FilteringClassLoader.java:91)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:180)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at java.lang.Class.forName0(Native Method)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at java.lang.Class.forName(Class.java:270)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.jersey.internal.util.ReflectionHelper$7.run(ReflectionHelper.java:403)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.jersey.internal.util.ReflectionHelper$7.run(ReflectionHelper.java:398)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at java.security.AccessController.doPrivileged(Native Method)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.jersey.internal.ServiceFinder$AbstractLazyIterator.hasNext(ServiceFinder.java:577)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.jersey.internal.ServiceFinder.toClassArray(ServiceFinder.java:418)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.jersey.internal.ServiceFinderBinder.configure(ServiceFinderBinder.java:90)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.hk2.utilities.binding.AbstractBinder.bind(AbstractBinder.java:171)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.hk2.utilities.binding.AbstractBinder.install(AbstractBinder.java:329)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.jersey.server.ServerBinder.configure(ServerBinder.java:94)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.hk2.utilities.binding.AbstractBinder.bind(AbstractBinder.java:171)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.jersey.internal.inject.Injections.bind(Injections.java:154)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.jersey.internal.inject.Injections._createLocator(Injections.java:144)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.jersey.internal.inject.Injections.createLocator(Injections.java:123)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:329)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:339)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:170)
**** Error Fri Aug 28 12:39:56 EDT 2015 1440779996519 / at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:362)
The reason of such exception is that ServiceFinder(loaded by current custom classloader) is using current thread's context classloader for loading services and as a result such classes are not found. All those service classes are coming with current custom classloader and not available for thread's context classloader. What I'm asking for is to change such logic and do fallback to current classloader. Something like Validation library are doing - http://grepcode.com/file/repo1.maven.org/maven2/javax.validation/validation-api/1.1.0.Final/javax/validation/Validation.java?av=f
I already had email conversation with Marek Potociar regarding this clasloading issue and he agreed to look into fallback with own classloader usage.
Note, that javax.ws.rs.client.FactoryFinder is having the same problem.
Environment
Weblogic 12.1.3, Java7
Affected Versions
[2.19]
The text was updated successfully, but these errors were encountered:
@glassfishrobot Commented @AdamLindenthal said:
Hi, thanks for opening the issue.
If you already discussed with Marek, I guess I can but the issue to backlog.
In case you want to help us, feel free to create a small runnable reproducer test case and share it.
Soooo... this issue is still persisting for me. No comments from the authors? I need to load jersey resources from "modules" (not java 9 modules, just external JARs that are loaded at runtime), via a custom classloader for isolation (and some other reasons).
When Jersey is loaded via custom classloader it's failing with ClassNotFoundException:
The reason of such exception is that ServiceFinder(loaded by current custom classloader) is using current thread's context classloader for loading services and as a result such classes are not found. All those service classes are coming with current custom classloader and not available for thread's context classloader. What I'm asking for is to change such logic and do fallback to current classloader. Something like Validation library are doing - http://grepcode.com/file/repo1.maven.org/maven2/javax.validation/validation-api/1.1.0.Final/javax/validation/Validation.java?av=f
I already had email conversation with Marek Potociar regarding this clasloading issue and he agreed to look into fallback with own classloader usage.
Note, that javax.ws.rs.client.FactoryFinder is having the same problem.
Environment
Weblogic 12.1.3, Java7
Affected Versions
[2.19]
The text was updated successfully, but these errors were encountered: