On demand resolution
thomas.diesler Mar 26, 2010 6:32 AMI created a test for DynamicImport-Package to check whether https://jira.jboss.org/jira/browse/JBCL-131 is actually working at the OSGi layer.
I still get a CNFE. Here is the trace
2010-03-26 11:24:06,939 INFO [org.jboss.osgi.framework.plugins.internal.FrameworkEventsPluginImpl] Bundle INSTALLED: Bundle{osgi.cmpn-4.2.0.200908310645} 2010-03-26 11:24:06,939 DEBUG [org.jboss.osgi.framework.bundle.OSGiBundleManager] Added: Bundle{osgi.cmpn-4.2.0.200908310645} 2010-03-26 11:24:06,940 DEBUG [org.jboss.classloading.spi.dependency.Domain] org.jboss.classloading.spi.dependency.Domain@191e4c{OSGiClassLoaderDomain} add module OSGiModule osgi.cmpn:4.2.0.200908310645 2010-03-26 11:24:06,940 TRACE [org.jboss.classloading.spi.dependency.ClassLoadingSpace] OSGiModule osgi.cmpn:4.2.0.200908310645 joining org.jboss.classloading.spi.dependency.ClassLoadingSpace@1984a9d 2010-03-26 11:24:06,943 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] OSGiBundleClassLoader@17ebe66{dynamic-log-service-0.0.0} loadClass org.osgi.service.log.LogService resolve=false 2010-03-26 11:24:06,944 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] OSGiBundleClassLoader@17ebe66{dynamic-log-service-0.0.0} aquireLockFairly Thread[main,5,main] 2010-03-26 11:24:06,945 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] OSGiBundleClassLoader@17ebe66{dynamic-log-service-0.0.0} aquiredLock Thread[main,5,main] holding=1 2010-03-26 11:24:06,947 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] OSGiBundleClassLoader@17ebe66{dynamic-log-service-0.0.0} load from domain org.osgi.service.log.LogService domain=OSGiClassLoaderDomain@2bfdff{OSGiClassLoaderDomain} 2010-03-26 11:24:06,947 TRACE [org.jboss.classloader.spi.base.BaseClassLoaderDomain] OSGiClassLoaderDomain@2bfdff{OSGiClassLoaderDomain} findLoader org/osgi/service/log/LogService.class classLoader=OSGiBundleClassLoader@17ebe66{dynamic-log-service-0.0.0} allExports=false findInParent=true 2010-03-26 11:24:06,948 TRACE [org.jboss.classloader.spi.ClassLoaderDomain] OSGiClassLoaderDomain@2bfdff{OSGiClassLoaderDomain} org/osgi/service/log/LogService.class does NOT match parent beforeFilter=[java], OSGI_CORE, [org.osgi.framework, org.osgi.framework.hooks, org.osgi.framework.hooks.service, org.osgi.framework.launch, org.osgi.service.condpermadmin, org.osgi.service.packageadmin, org.osgi.service.permissionadmin, org.osgi.service.startlevel, org.osgi.service.url, javax.imageio, javax.imageio.stream, javax.management, javax.management.loading, javax.management.modelmbean, javax.management.monitor, javax.management.openmbean, javax.management.relation, javax.management.remote, javax.management.remote.rmi, javax.management.timer, javax.naming, javax.naming.event, javax.naming.spi, javax.net, javax.net.ssl, javax.xml.datatype, javax.xml.namespace, javax.xml.parsers, javax.xml.transform, javax.xml.transform.dom, javax.xml.transform.sax, javax.xml.transform.stream, javax.xml.validation, org.apache.log4j, org.jboss.beans.metadata.plugins.builder, org.jboss.beans.metadata.plugins, org.jboss.beans.metadata.spi.builder, org.jboss.beans.metadata.spi, org.jboss.dependency.spi, org.jboss.kernel.spi.dependency, org.jboss.logging, org.jboss.osgi.deployment.deployer, org.jboss.osgi.deployment.interceptor, org.jboss.osgi.spi.capability, org.jboss.osgi.spi.framework, org.jboss.osgi.spi.service, org.jboss.osgi.spi.util, org.jboss.osgi.spi, org.jboss.osgi.testing, org.w3c.dom, org.w3c.dom.bootstrap, org.w3c.dom.events, org.w3c.dom.ls, org.w3c.dom.ranges, org.w3c.dom.traversal, org.w3c.dom.views, org.xml.sax, org.xml.sax.ext, org.xml.sax.helpers] 2010-03-26 11:24:06,948 TRACE [org.jboss.classloader.spi.base.BaseClassLoaderDomain] OSGiClassLoaderDomain@2bfdff{OSGiClassLoaderDomain} not loading org/osgi/service/log/LogService.class from all exports 2010-03-26 11:24:06,948 TRACE [org.jboss.classloader.spi.base.BaseClassLoaderDomain] OSGiClassLoaderDomain@2bfdff{OSGiClassLoaderDomain} trying to load org/osgi/service/log/LogService.class from import LazyFilteredDelegateLoader@12dd76{factory=org.jboss.classloading.spi.dependency.policy.DynamicClassLoaderPolicyFactory@8990e4} for OSGiBundleClassLoader@17ebe66{dynamic-log-service-0.0.0} 2010-03-26 11:24:06,948 TRACE [org.jboss.classloader.spi.filter.FilteredDelegateLoader] LazyFilteredDelegateLoader@12dd76{factory=org.jboss.classloading.spi.dependency.policy.DynamicClassLoaderPolicyFactory@8990e4} org/osgi/service/log/LogService.class matches resource filter=<EVERYTHING> 2010-03-26 11:24:06,948 TRACE [org.jboss.classloading.spi.dependency.ClassLoadingSpace] OSGiModule dynamic-log-service:0.0.0 resolving org.jboss.classloading.spi.dependency.ClassLoadingSpace@d306dd 2010-03-26 11:24:06,948 TRACE [org.jboss.classloader.spi.base.BaseDelegateLoader] Factory did not create a delegate: org.jboss.classloading.spi.dependency.policy.DynamicClassLoaderPolicyFactory@8990e4 2010-03-26 11:24:06,949 WARN [org.jboss.classloader.spi.base.BaseDelegateLoader] Not getting resource org/osgi/service/log/LogService.class from policy that has no classLoader: LazyFilteredDelegateLoader@12dd76{factory=org.jboss.classloading.spi.dependency.policy.DynamicClassLoaderPolicyFactory@8990e4 filter=<EVERYTHING>} 2010-03-26 11:24:06,949 TRACE [org.jboss.classloader.spi.base.BaseClassLoaderDomain] OSGiClassLoaderDomain@2bfdff{OSGiClassLoaderDomain} trying to load org/osgi/service/log/LogService.class from requesting OSGiBundleClassLoader@17ebe66{dynamic-log-service-0.0.0} 2010-03-26 11:24:06,949 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] OSGiBundleClassLoader@17ebe66{dynamic-log-service-0.0.0} get resource locally org/osgi/service/log/LogService.class 2010-03-26 11:24:06,950 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] OSGiBundleClassLoader@17ebe66{dynamic-log-service-0.0.0} resource not found locally org/osgi/service/log/LogService.class 2010-03-26 11:24:06,950 TRACE [org.jboss.classloader.spi.ClassLoaderDomain] OSGiClassLoaderDomain@2bfdff{OSGiClassLoaderDomain} org/osgi/service/log/LogService.class does NOT match parent afterFilter=<NOTHING> 2010-03-26 11:24:06,952 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] OSGiBundleClassLoader@17ebe66{dynamic-log-service-0.0.0} unlock Thread[main,5,main] holding=1 2010-03-26 11:24:06,952 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] OSGiBundleClassLoader@17ebe66{dynamic-log-service-0.0.0} class not found org.osgi.service.log.LogService
Perhaps these are of special interest
[org.jboss.classloader.spi.base.BaseDelegateLoader] Factory did not create a delegate: org.jboss.classloading.spi.dependency.policy.DynamicClassLoaderPolicyFactory@8990e4 [org.jboss.classloader.spi.base.BaseDelegateLoader] Not getting resource org/osgi/service/log/LogService.class from policy that has no classLoader: LazyFilteredDelegateLoader@12dd76{factory=org.jboss.classloading.spi.dependency.policy.DynamicClassLoaderPolicyFactory@8990e4 filter=<EVERYTHING>}
Looking at the documentation I can't see waht I have missed. Just joking, there is of course no documentation on how this is suposed to work. I reopend the issue.