Hi David, The problem is that I'm trying to contribute a new service to load, but from another bundle (kind of Provider one), that is, this ServiceLoader.load (Class, ClassLoader) won't see this extension. May turning this provider to a Bundle Fragment could do the trick?
Regards, 2014-11-05 10:47 GMT+01:00 David Bosschaert <[email protected]>: > Hi Charlie > > On 5 November 2014 09:41, Charlie Mordant <[email protected]> wrote: > > Hi again, > > > > Reading the docs, Aries spi-fly is only weaving > > java.util.ServiceLoader#load(java.lang.Class) method signature. > > Unfortunately, in deltaspike, they use > > java.util.ServiceLoader#load(java.lang.Class, ClassLoader), where the > > classloader used is the one from the ServiceUtils one (ds-api one). > > > > Is there a way to hack this? > > The main problem with ServiceLoader.load(Class) is that it uses the > Thread Context Classloader to decide where to look for providers. > > When you're using ServiceLoader.load(Class, ClassLoader) you're > already providing the classloader so at least the TCCL problem isn't > there, so it may just work without SPI-Fly. If not, what is the > remaining problem? If there is one, we should enhance SPI Fly to > support it... > > Cheers, > > David > -- Charlie Mordant Full OSGI/EE stack made with Karaf: https://github.com/OsgiliathEnterprise/net.osgiliath.parent
