felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: problem while loading classes using Boot Delegation
Date Thu, 06 Jan 2011 16:50:56 GMT
By default, boot delegation is to the boot class loader, not the 
application class loader. Perhaps you need to set:

     org.osgi.framework.bundle.parent=app

-> richard

On 1/6/11 11:28, Pierre De Rop wrote:
> Hi;
>
> We are using latest Felix trunk framework + framework.security, and we are
> trying to use cobertura 1.9.4.1 for code coverage purpose.
> After having instrumented our bundles, we start Felix by providing
> cobertura.jar in the classpath, and we also configure our framework
> with the following boot delegation parameter:
>
>    org.osgi.framework.bootdelegation=net.sourceforge.cobertura.*
>
> But it seems that cobertura classes can't be loaded at runtime from boot
> delegation, and we get this exception at startup:
>
> java.lang.NoClassDefFoundError:
> net/sourceforge/cobertura/coveragedata/HasBeenInstrumented
>          at java.lang.ClassLoader.defineClass1(Native Method)
>          at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
>          at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
>          at
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1907)
>          at
> org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:727)
>          at
> org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
>          at
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
>          at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
>          at
> org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:645)
>          at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1604)
>          at
> org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:904)
>          at
> com.alcatel.as.util.cl.BundleClassLoader.loadClass(BundleClassLoader.java:40)
>          at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
>          at
> com.alcatel.as.proxylet.deployer.impl.PxletDeployerImpl.loadProxylets(PxletDeployerImpl.java:350)
>          at
> com.alcatel.as.proxylet.deployer.impl.PxletDeployerImpl.applicationDiscovered(PxletDeployerImpl.java:264)
>          at
> com.alcatel.as.proxylet.deployer.impl.PxletDeployerImpl.start(PxletDeployerImpl.java:106)
>          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>          at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>          at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>          at java.lang.reflect.Method.invoke(Method.java:597)
>          at
> org.apache.felix.dependencymanager.ServiceImpl.invoke(ServiceImpl.java:484)
>          at
> org.apache.felix.dependencymanager.ServiceImpl.activateService(ServiceImpl.java:441)
>          at
> org.apache.felix.dependencymanager.ServiceImpl.access$000(ServiceImpl.java:44)
>          at
> org.apache.felix.dependencymanager.ServiceImpl$1.run(ServiceImpl.java:113)
>          at
> org.apache.felix.dependencymanager.SerialExecutor$1.run(SerialExecutor.java:47)
>          at
> org.apache.felix.dependencymanager.SerialExecutor.scheduleNext(SerialExecutor.java:84)
>          at
> org.apache.felix.dependencymanager.SerialExecutor.execute(SerialExecutor.java:68)
>          at
> org.apache.felix.dependencymanager.ServiceImpl.calculateStateChanges(ServiceImpl.java:147)
>          at
> org.apache.felix.dependencymanager.ServiceImpl.dependencyAvailable(ServiceImpl.java:205)
>          at
> org.apache.felix.dependencymanager.ServiceDependency.addedService(ServiceDependency.java:343)
>          at
> org.apache.felix.dependencymanager.ServiceTracker$Tracked.trackAdding(ServiceTracker.java:1052)
>          at
> org.apache.felix.dependencymanager.ServiceTracker$Tracked.track(ServiceTracker.java:999)
>          at
> org.apache.felix.dependencymanager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:932)
>          at
> org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:871)
>          at
> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:733)
>          at
> org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:662)
>          at
> org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3735)
>          at org.apache.felix.framework.Felix.access$000(Felix.java:80)
>          at org.apache.felix.framework.Felix$2.serviceChanged(Felix.java:722)
>          at
> org.apache.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:107)
>          at org.apache.felix.framework.Felix.registerService(Felix.java:2847)
>          at
> org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:251)
>          at
> org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:229)
>          at
> com.alcatel.as.service.config.impl.fc.OsgiConfigurationAdmin$Conf.update(OsgiConfigurationAdmin.java:276)
>          at
> com.alcatel.as.service.config.impl.fc.OsgiConfigurationAdmin$Conf.update(OsgiConfigurationAdmin.java:244)
>          at
> com.alcatel.as.service.config.impl.fc.OsgiConfigurationAdmin$Conf.access$000(OsgiConfigurationAdmin.java:191)
>          at
> com.alcatel.as.service.config.impl.fc.OsgiConfigurationAdmin.configure(OsgiConfigurationAdmin.java:136)
>          at
> com.alcatel.as.service.config.impl.fc.FastCacheConfig.init2(FastCacheConfig.java:280)
>          at
> com.alcatel.as.service.config.impl.fc.FastCacheConfig.proxyAppPropertiesUpdated(FastCacheConfig.java:311)
>          at
> com.nextenso.mgmt.reporter.ProxyAppReporter$FastCacheListeningThread.run(ProxyAppReporter.java:180)
> Caused by: java.lang.ClassNotFoundException:
> net.sourceforge.cobertura.coveragedata.HasBeenInstrumented not found by
> HttpProxyletBasicProxy [2]
>          at
> org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787)
>          at
> org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
>          at
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
>          at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
>          ... 50 more
>
>
> So, I have checked if the ModuleImpl.findClassOrResourceByDelegation()
> method correctly enters in the "if (shouldBootDelegate(pkgName)" statement,
> line 694, and this is the case.
> However, when loading the class
> net.sourceforge.cobertura.coveragedata.HasBeenInstrumented from the bdcl
> classloader, then we get the following exception in ModuleImpl, line 698:
>
> 2011-01-06 17:19:20,857 Stdout ERROR stderr  -
> java.lang.ClassNotFoundException:
> net.sourceforge.cobertura.coveragedata.HasBeenInstrumented
> 2011-01-06 17:19:20,880 Stdout ERROR stderr  -  at
> java.lang.ClassLoader.findClass(ClassLoader.java:359)
> 2011-01-06 17:19:20,880 Stdout ERROR stderr  -  at
> java.lang.ClassLoader.loadClass(ClassLoader.java:307)
> 2011-01-06 17:19:20,880 Stdout ERROR stderr  -  at
> java.lang.ClassLoader.loadClass(ClassLoader.java:248)
> 2011-01-06 17:19:20,880 Stdout ERROR stderr  -  at
> org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:698)
> 2011-01-06 17:19:20,880 Stdout ERROR stderr  -  at
> org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
> 2011-01-06 17:19:20,880 Stdout ERROR stderr  -  at
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
> 2011-01-06 17:19:20,880 Stdout ERROR stderr  -  at
> java.lang.ClassLoader.loadClass(ClassLoader.java:248)
> 2011-01-06 17:19:20,880 Stdout ERROR stderr  -  at
> java.lang.ClassLoader.defineClass1(Native Method)
> 2011-01-06 17:19:20,880 Stdout ERROR stderr  -  at
> java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
> 2011-01-06 17:19:20,880 Stdout ERROR stderr  -  at
> java.lang.ClassLoader.defineClass(ClassLoader.java:616)
> 2011-01-06 17:19:20,880 Stdout ERROR stderr  -  at
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1907)
> 2011-01-06 17:19:20,880 Stdout ERROR stderr  -  at
> org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:727)
> 2011-01-06 17:19:20,880 Stdout ERROR stderr  -  at
> org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
> 2011-01-06 17:19:20,881 Stdout ERROR stderr  -  at
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
> 2011-01-06 17:19:20,881 Stdout ERROR stderr  -  at
> java.lang.ClassLoader.loadClass(ClassLoader.java:248)
> 2011-01-06 17:19:20,881 Stdout ERROR stderr  -  at
> org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:645)
> 2011-01-06 17:19:20,881 Stdout ERROR stderr  -  at
> org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1604)
> 2011-01-06 17:19:20,881 Stdout ERROR stderr  -  at
> org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:904)
> 2011-01-06 17:19:20,881 Stdout ERROR stderr  -  at
> com.alcatel.as.util.cl.BundleClassLoader.loadClass(BundleClassLoader.java:40)
> 2011-01-06 17:19:20,881 Stdout ERROR stderr  -  at
> java.lang.ClassLoader.loadClass(ClassLoader.java:248)
> 2011-01-06 17:19:20,881 Stdout ERROR stderr  -  at
> com.alcatel.as.proxylet.deployer.impl.PxletDeployerImpl.loadProxylets(PxletDeployerImpl.java:350)
> 2011-01-06 17:19:20,881 Stdout ERROR stderr  -  at
> com.alcatel.as.proxylet.deployer.impl.PxletDeployerImpl.applicationDiscovered(PxletDeployerImpl.java:264)
> 2011-01-06 17:19:20,881 Stdout ERROR stderr  -  at
> com.alcatel.as.proxylet.deployer.impl.PxletDeployerImpl.start(PxletDeployerImpl.java:106)
> 2011-01-06 17:19:20,881 Stdout ERROR stderr  -  at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 2011-01-06 17:19:20,881 Stdout ERROR stderr  -  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 2011-01-06 17:19:20,884 Stdout ERROR stderr  -  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 2011-01-06 17:19:20,884 Stdout ERROR stderr  -  at
> java.lang.reflect.Method.invoke(Method.java:597)
> 2011-01-06 17:19:20,885 Stdout ERROR stderr  -  at
> org.apache.felix.dependencymanager.ServiceImpl.invoke(ServiceImpl.java:484)
> 2011-01-06 17:19:20,885 Stdout ERROR stderr  -  at
> org.apache.felix.dependencymanager.ServiceImpl.activateService(ServiceImpl.java:441)
> 2011-01-06 17:19:20,885 Stdout ERROR stderr  -  at
> org.apache.felix.dependencymanager.ServiceImpl.access$000(ServiceImpl.java:44)
> 2011-01-06 17:19:20,885 Stdout ERROR stderr  -  at
> org.apache.felix.dependencymanager.ServiceImpl$1.run(ServiceImpl.java:113)
> 2011-01-06 17:19:20,885 Stdout ERROR stderr  -  at
> org.apache.felix.dependencymanager.SerialExecutor$1.run(SerialExecutor.java:47)
> 2011-01-06 17:19:20,885 Stdout ERROR stderr  -  at
> org.apache.felix.dependencymanager.SerialExecutor.scheduleNext(SerialExecutor.java:84)
> 2011-01-06 17:19:20,885 Stdout ERROR stderr  -  at
> org.apache.felix.dependencymanager.SerialExecutor.execute(SerialExecutor.java:68)
> 2011-01-06 17:19:20,885 Stdout ERROR stderr  -  at
> org.apache.felix.dependencymanager.ServiceImpl.calculateStateChanges(ServiceImpl.java:147)
> 2011-01-06 17:19:20,886 Stdout ERROR stderr  -  at
> org.apache.felix.dependencymanager.ServiceImpl.dependencyAvailable(ServiceImpl.java:205)
> 2011-01-06 17:19:20,886 Stdout ERROR stderr  -  at
> org.apache.felix.dependencymanager.ServiceDependency.addedService(ServiceDependency.java:343)
> 2011-01-06 17:19:20,886 Stdout ERROR stderr  -  at
> org.apache.felix.dependencymanager.ServiceTracker$Tracked.trackAdding(ServiceTracker.java:1052)
> 2011-01-06 17:19:20,886 Stdout ERROR stderr  -  at
> org.apache.felix.dependencymanager.ServiceTracker$Tracked.track(ServiceTracker.java:999)
> 2011-01-06 17:19:20,886 Stdout ERROR stderr  -  at
> org.apache.felix.dependencymanager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:932)
> 2011-01-06 17:19:20,886 Stdout ERROR stderr  -  at
> org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:871)
> 2011-01-06 17:19:20,887 Stdout ERROR stderr  -  at
> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:733)
> 2011-01-06 17:19:20,887 Stdout ERROR stderr  -  at
> org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:662)
> 2011-01-06 17:19:20,887 Stdout ERROR stderr  -  at
> org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3735)
> 2011-01-06 17:19:20,887 Stdout ERROR stderr  -  at
> org.apache.felix.framework.Felix.access$000(Felix.java:80)
> 2011-01-06 17:19:20,888 Stdout ERROR stderr  -  at
> org.apache.felix.framework.Felix$2.serviceChanged(Felix.java:722)
> 2011-01-06 17:19:20,888 Stdout ERROR stderr  -  at
> org.apache.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:107)
> 2011-01-06 17:19:20,888 Stdout ERROR stderr  -  at
> org.apache.felix.framework.Felix.registerService(Felix.java:2847)
> 2011-01-06 17:19:20,888 Stdout ERROR stderr  -  at
> org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:251)
> 2011-01-06 17:19:20,889 Stdout ERROR stderr  -  at
> org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:229)
> 2011-01-06 17:19:20,889 Stdout ERROR stderr  -  at
> com.alcatel.as.service.config.impl.fc.OsgiConfigurationAdmin$Conf.update(OsgiConfigurationAdmin.java:276)
> 2011-01-06 17:19:20,890 Stdout ERROR stderr  -  at
> com.alcatel.as.service.config.impl.fc.OsgiConfigurationAdmin$Conf.update(OsgiConfigurationAdmin.java:244)
> 2011-01-06 17:19:20,891 Stdout ERROR stderr  -  at
> com.alcatel.as.service.config.impl.fc.OsgiConfigurationAdmin$Conf.access$000(OsgiConfigurationAdmin.java:191)
> 2011-01-06 17:19:20,892 Stdout ERROR stderr  -  at
> com.alcatel.as.service.config.impl.fc.OsgiConfigurationAdmin.configure(OsgiConfigurationAdmin.java:136)
> 2011-01-06 17:19:20,892 Stdout ERROR stderr  -  at
> com.alcatel.as.service.config.impl.fc.FastCacheConfig.init2(FastCacheConfig.java:280)
> 2011-01-06 17:19:20,892 Stdout ERROR stderr  -  at
> com.alcatel.as.service.config.impl.fc.FastCacheConfig.proxyAppPropertiesUpdated(FastCacheConfig.java:311)
> 2011-01-06 17:19:20,893 Stdout ERROR stderr  -  at
> com.nextenso.mgmt.reporter.ProxyAppReporter$FastCacheListeningThread.run(ProxyAppReporter.java:180)
>
> Any idea about this probleme ?
> Thanks.
>
> /pierre
>

Mime
View raw message