Bug 561827 - Server side plugin classloaders do not honor META-INF/service/*
Server side plugin classloaders do not honor META-INF/service/*
Status: CLOSED WONTFIX
Product: RHQ Project
Classification: Other
Component: Core Server (Show other bugs)
1.4
All All
low Severity high (vote)
: ---
: ---
Assigned To: John Mazzitelli
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-02-04 08:20 EST by Heiko W. Rupp
Modified: 2014-05-27 14:34 EDT (History)
2 users (show)

See Also:
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:


Attachments (Terms of Use)

  None (edit)
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.

Note You need to log in before you can comment on or make changes to this bug.