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? Regards, 2014-10-26 20:57 GMT+01:00 Charlie Mordant <[email protected]>: > A simple sample (the one I'm trying to set up) consist in trying to > contribute to deltaspike config source provider ( > https://deltaspike.apache.org/documentation/configuration.html#_configsources_provided_by_default), > for example with a 'Config admin' config source provider :p. > > Do you want the test code? Not so hard to set up. > It may comes from the fact that the class to weave (ServiceUtils) is: > * abstract > * has a private constructor > * has a private static final field on itself (the logger). > > Regards, > > > 2014-10-26 20:34 GMT+01:00 Jean-Baptiste Onofré <[email protected]>: > >> It's what I thought. I will check ASAP. >> >> Regards >> JB >> >> >> Sent from my Samsung Galaxy smartphone. >> >> >> -------- Original message -------- >> From: Charlie Mordant <[email protected]> >> Date:26/10/2014 20:10 (GMT+01:00) >> To: [email protected] >> Cc: >> Subject: Re: Aries Spi-Fly, Karaf 3.0.2 and NPE >> >> Hi again, >> >> It neither work on 3.0.1 :( >> >> >> 2014-10-26 18:53 GMT+01:00 Charlie Mordant <[email protected]>: >> >>> Hi J.B. >>> >>> Will be able to answer soon :). >>> >>> 2014-10-26 18:50 GMT+01:00 Jean-Baptiste Onofré <[email protected]>: >>> >>>> Hi Charlie >>>> >>>> Is it only with Karaf 3.0.2 or with 3.0.1 also ? >>>> >>>> Thanks >>>> Regards >>>> JB >>>> >>>> >>>> Sent from my Samsung Galaxy smartphone. >>>> >>>> >>>> -------- Original message -------- >>>> From: Charlie Mordant <[email protected]> >>>> Date:26/10/2014 18:01 (GMT+01:00) >>>> To: [email protected] >>>> Cc: >>>> Subject: Aries Spi-Fly, Karaf 3.0.2 and NPE >>>> >>>> Hi, >>>> >>>> I'm trying to inject a service in a dynamically woven consumer (with >>>> Spi-Fly). >>>> Unfortunately, I end with a trace on the class that uses the >>>> ServiceLoader.load() method. >>>> >>>> Have you ever encountered this issue? Is there any workaround ? >>>> >>>> Here's the full stacktrace: >>>> >>>> 2014-10-26 17:12:32,115 | DEBUG | lixDispatchQueue | bundle >>>> | 124 - org.apache.aries.spifly.dynamic.bundle - 1.0.1 | >>>> FrameworkEvent ERROR - org.apache.aries.spifly.dynamic.bundle >>>> >>>> java.lang.IllegalArgumentException: value null >>>> >>>> at org.objectweb.asm.ClassWriter.a(Unknown >>>> Source)[8:org.objectweb.asm.all:5.0.3] >>>> >>>> at org.objectweb.asm.MethodWriter.visitLdcInsn(Unknown >>>> Source)[8:org.objectweb.asm.all:5.0.3] >>>> >>>> at >>>> org.apache.aries.spifly.weaver.TCCLSetterVisitor$TCCLSetterMethodVisitor.visitMethodInsn(TCCLSetterVisitor.java:194)[124:org.apache.aries.spifly.dynamic.bundle:1.0.1] >>>> >>>> at org.objectweb.asm.MethodVisitor.visitMethodInsn(Unknown >>>> Source)[8:org.objectweb.asm.all:5.0.3] >>>> >>>> at org.objectweb.asm.ClassReader.a(Unknown >>>> Source)[8:org.objectweb.asm.all:5.0.3] >>>> >>>> at org.objectweb.asm.ClassReader.b(Unknown >>>> Source)[8:org.objectweb.asm.all:5.0.3] >>>> >>>> at org.objectweb.asm.ClassReader.accept(Unknown >>>> Source)[8:org.objectweb.asm.all:5.0.3] >>>> >>>> at org.objectweb.asm.ClassReader.accept(Unknown >>>> Source)[8:org.objectweb.asm.all:5.0.3] >>>> >>>> at >>>> org.apache.aries.spifly.dynamic.ClientWeavingHook.weave(ClientWeavingHook.java:61)[124:org.apache.aries.spifly.dynamic.bundle:1.0.1] >>>> >>>> at >>>> org.apache.felix.framework.util.SecureAction.invokeWeavingHook(SecureAction.java:1127)[org.apache.felix.framework-4.2.1.jar:] >>>> >>>> at >>>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2057)[org.apache.felix.framework-4.2.1.jar:] >>>> >>>> at >>>> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)[org.apache.felix.framework-4.2.1.jar:] >>>> >>>> at >>>> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:] >>>> >>>> at >>>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)[org.apache.felix.framework-4.2.1.jar:] >>>> >>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_67] >>>> >>>> at >>>> org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1844)[org.apache.felix.framework-4.2.1.jar:] >>>> >>>> at >>>> org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)[org.apache.felix.framework-4.2.1.jar:] >>>> >>>> at >>>> org.apache.xbean.osgi.bundle.util.DelegatingBundle.findCachedClass(DelegatingBundle.java:201)[127:org.apache.xbean.bundleutils:3.18.0] >>>> >>>> at >>>> org.apache.xbean.osgi.bundle.util.DelegatingBundle.loadClass(DelegatingBundle.java:181)[127:org.apache.xbean.bundleutils:3.18.0] >>>> >>>> at >>>> org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176)[160:org.ops4j.pax.swissbox.core:1.8.0] >>>> >>>> at >>>> org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:194)[160:org.ops4j.pax.swissbox.core:1.8.0] >>>> >>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_67] >>>> >>>> at >>>> org.ops4j.pax.cdi.weld.impl.bda.AbstractClassLoaderResourceLoader.classForName(AbstractClassLoaderResourceLoader.java:44)[169:org.ops4j.pax.cdi.weld:0.9.0] >>>> >>>> at >>>> org.jboss.weld.bootstrap.BeanDeployer.loadClass(BeanDeployer.java:106)[166:org.jboss.weld.osgi-bundle:2.1.2.Final] >>>> >>>> at >>>> org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:94)[166:org.jboss.weld.osgi-bundle:2.1.2.Final] >>>> >>>> at >>>> org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:62)[166:org.jboss.weld.osgi-bundle:2.1.2.Final] >>>> >>>> at >>>> org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:60)[166:org.jboss.weld.osgi-bundle:2.1.2.Final] >>>> >>>> at >>>> org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)[166:org.jboss.weld.osgi-bundle:2.1.2.Final] >>>> >>>> at >>>> org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)[166:org.jboss.weld.osgi-bundle:2.1.2.Final] >>>> >>>> at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_67] >>>> >>>> at >>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_67] >>>> >>>> at >>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_67] >>>> >>>> at java.lang.Thread.run(Thread.java:745)[:1.7.0_67] >>>> >>>> 2014-10-26 17:12:32,116 | INFO | weld-worker-4 | Bootstrap >>>> | 167 - org.jboss.logging.jboss-logging - 3.1.3.GA | >>>> WELD-000119: Not generating any bean definitions from >>>> org.apache.deltaspike.core.util.ServiceUtils because of underlying class >>>> loading error: Type [unknown] not found. If this is unexpected, enable >>>> DEBUG logging to see the full error. >>>> >>>> 2014-10-26 17:12:32,117 | DEBUG | weld-worker-4 | Bootstrap >>>> | 167 - org.jboss.logging.jboss-logging - 3.1.3.GA | >>>> Catching >>>> >>>> org.jboss.weld.resources.spi.ResourceLoadingException: Error loading >>>> class org.apache.deltaspike.core.util.ServiceUtils >>>> >>>> at >>>> org.ops4j.pax.cdi.weld.impl.bda.AbstractClassLoaderResourceLoader.classForName(AbstractClassLoaderResourceLoader.java:50)[169:org.ops4j.pax.cdi.weld:0.9.0] >>>> >>>> at >>>> org.jboss.weld.bootstrap.BeanDeployer.loadClass(BeanDeployer.java:106)[166:org.jboss.weld.osgi-bundle:2.1.2.Final] >>>> >>>> at >>>> org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:94)[166:org.jboss.weld.osgi-bundle:2.1.2.Final] >>>> >>>> at >>>> org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:62)[166:org.jboss.weld.osgi-bundle:2.1.2.Final] >>>> >>>> at >>>> org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:60)[166:org.jboss.weld.osgi-bundle:2.1.2.Final] >>>> >>>> at >>>> org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)[166:org.jboss.weld.osgi-bundle:2.1.2.Final] >>>> >>>> at >>>> org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)[166:org.jboss.weld.osgi-bundle:2.1.2.Final] >>>> >>>> at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_67] >>>> >>>> at >>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_67] >>>> >>>> at >>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_67] >>>> >>>> at java.lang.Thread.run(Thread.java:745)[:1.7.0_67] >>>> >>>> Caused by: java.lang.ClassFormatError: Weaving hook failed. >>>> >>>> at >>>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2074) >>>> >>>> at >>>> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501) >>>> >>>> at >>>> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75) >>>> >>>> at >>>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955) >>>> >>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_67] >>>> >>>> at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1844) >>>> >>>> at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937) >>>> >>>> at >>>> org.apache.xbean.osgi.bundle.util.DelegatingBundle.findCachedClass(DelegatingBundle.java:201) >>>> >>>> at >>>> org.apache.xbean.osgi.bundle.util.DelegatingBundle.loadClass(DelegatingBundle.java:181) >>>> >>>> at >>>> org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176)[160:org.ops4j.pax.swissbox.core:1.8.0] >>>> >>>> at >>>> org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:194)[160:org.ops4j.pax.swissbox.core:1.8.0] >>>> >>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_67] >>>> >>>> at >>>> org.ops4j.pax.cdi.weld.impl.bda.AbstractClassLoaderResourceLoader.classForName(AbstractClassLoaderResourceLoader.java:44)[169:org.ops4j.pax.cdi.weld:0.9.0] >>>> >>>> ... 10 more >>>> >>>> Caused by: java.lang.IllegalArgumentException: value null >>>> >>>> at org.objectweb.asm.ClassWriter.a(Unknown >>>> Source)[8:org.objectweb.asm.all:5.0.3] >>>> >>>> at org.objectweb.asm.MethodWriter.visitLdcInsn(Unknown >>>> Source)[8:org.objectweb.asm.all:5.0.3] >>>> >>>> at >>>> org.apache.aries.spifly.weaver.TCCLSetterVisitor$TCCLSetterMethodVisitor.visitMethodInsn(TCCLSetterVisitor.java:194)[124:org.apache.aries.spifly.dynamic.bundle:1.0.1] >>>> >>>> at org.objectweb.asm.MethodVisitor.visitMethodInsn(Unknown >>>> Source)[8:org.objectweb.asm.all:5.0.3] >>>> >>>> at org.objectweb.asm.ClassReader.a(Unknown >>>> Source)[8:org.objectweb.asm.all:5.0.3] >>>> >>>> at org.objectweb.asm.ClassReader.b(Unknown >>>> Source)[8:org.objectweb.asm.all:5.0.3] >>>> >>>> at org.objectweb.asm.ClassReader.accept(Unknown >>>> Source)[8:org.objectweb.asm.all:5.0.3] >>>> >>>> at org.objectweb.asm.ClassReader.accept(Unknown >>>> Source)[8:org.objectweb.asm.all:5.0.3] >>>> >>>> at >>>> org.apache.aries.spifly.dynamic.ClientWeavingHook.weave(ClientWeavingHook.java:61)[124:org.apache.aries.spifly.dynamic.bundle:1.0.1] >>>> >>>> at >>>> org.apache.felix.framework.util.SecureAction.invokeWeavingHook(SecureAction.java:1127)[org.apache.felix.framework-4.2.1.jar:] >>>> >>>> at >>>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2057)[org.apache.felix.framework-4.2.1.jar:] >>>> >>>> ... 22 more >>>> >>>> >>>> >>>> -- >>>> Charlie Mordant >>>> >>>> Full OSGI/EE stack made with Karaf: >>>> https://github.com/OsgiliathEnterprise/net.osgiliath.parent >>>> >>> >>> >>> >>> -- >>> Charlie Mordant >>> >>> Full OSGI/EE stack made with Karaf: >>> https://github.com/OsgiliathEnterprise/net.osgiliath.parent >>> >> >> >> >> -- >> Charlie Mordant >> >> Full OSGI/EE stack made with Karaf: >> https://github.com/OsgiliathEnterprise/net.osgiliath.parent >> > > > > -- > Charlie Mordant > > Full OSGI/EE stack made with Karaf: > https://github.com/OsgiliathEnterprise/net.osgiliath.parent > -- Charlie Mordant Full OSGI/EE stack made with Karaf: https://github.com/OsgiliathEnterprise/net.osgiliath.parent
