Bug 561827

Summary: Server side plugin classloaders do not honor META-INF/service/*
Product: [Other] RHQ Project Reporter: Heiko W. Rupp <hrupp>
Component: Core ServerAssignee: John Mazzitelli <mazz>
Status: CLOSED WONTFIX QA Contact:
Severity: high Docs Contact:
Priority: low    
Version: 1.4CC: cwelton, jshaughn
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-27 14:34:51 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Heiko W. Rupp 2010-02-04 08:20:20 EST
Packages like RESTEasy or jruby-complete.jar (JSR-223 support) rely on classloaders reading files in META-INF/services/ and instantiating classes from there. 

E.g. RESTEasy uses it to find a concrete implementation of com.sun.ws.rs.ext.RuntimeDelegateImpl

----------- /im/rhq/modules/enterprise/server/plugins/alert-sms/src/main/resources/META-INF/services/javax.ws.rs.ext.RuntimeDelegate ---
org.jboss.resteasy.spi.ResteasyProviderFactory
----------------------------------------------------

Unfortunately it looks like this file is never consulted, which ends up in 

14:07:50,064 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: com.sun.ws.rs.ext.RuntimeDelegateImpl


So users that want to use RESTeasy in their alert-plugin will not be able to use it.

In the above example, I copied the file to $plugin-jar/META-INF/lib, but optimally it should be obtained from $plugin-jar/lib/resteasy-jaxrs.jar   or in the jruby case from $plugin-jar/lib/jruby-complete.jar
Comment 1 Heiko W. Rupp 2010-02-04 10:05:17 EST
In both cases, copying the jruby jar or the resteasy jars to jbossas/server/default/lib fixes the issue (for resteasy at least the one listed here).

For jruby-complete putting into server/default/lib it completely fixes it.
Comment 2 John Mazzitelli 2010-09-30 10:22:46 EDT
this would involve non-trivial amount of work. to fix, we'd have to put it on the dev plan to block out some time to do it. Needs at least a few days of work (just a guess).
Comment 3 Jay Shaughnessy 2014-05-27 14:34:51 EDT
Never given priority. closing.