-
2. Re: Bundle.start() does not transition to ACTIVE
thomas.diesler Aug 22, 2009 4:37 PM (in response to thomas.diesler)I added some cause analysis and it seems that both PackageRequirements should either not be there or get resolved.
org.osgi.framework: from declared system packages
org.jboss.test.osgi.simple.bundle: from the bundle itselftestBundleInstallLauchAPI(org.jboss.test.osgi.simple.SimpleBundleTestCase) Time elapsed: 4.215 sec <<< ERROR! org.osgi.framework.BundleException: Cannot start bundle Bundle{simple-bundle:0.0.0}, because of unresolved dependencies [PackageRequirement{org.osgi.framework [0.0.0,?)}, PackageRequirement{org.jboss.test.osgi.simple.bundle [0.0.0,?)}] at org.jboss.osgi.plugins.facade.bundle.OSGiBundleManager.start(OSGiBundleManager.java:494) at org.jboss.osgi.plugins.facade.bundle.OSGiBundleState.start(OSGiBundleState.java:736) at org.jboss.osgi.plugins.facade.bundle.OSGiBundleState.start(OSGiBundleState.java:724) at org.jboss.osgi.plugins.facade.bundle.OSGiBundleWrapper.start(OSGiBundleWrapper.java:176) at org.jboss.test.osgi.simple.SimpleBundleTestCase.testBundleInstallLauchAPI(SimpleBundleTestCase.java:62)
-
3. Re: Bundle.start() does not transition to ACTIVE
thomas.diesler Aug 22, 2009 5:04 PM (in response to thomas.diesler)I now throw a BundleException on unresolved RequirementDependencyItems
The problem of
org.osgi.framework.BundleException: Cannot start bundle Bundle{simple-bundle:0.0.0}, because of unresolved dependencies
PackageRequirement{org.osgi.framework [0.0.0,?)},
PackageRequirement{org.jboss.test.osgi.simple.bundle [0.0.0,?)}]
I fixed by only adding PackageRequirement for packages that are not system and not exported.
Please see OSGiBundleClassLoadingDeployer for details
This probably needs some more work, because a simple package name match between the import and the export is not sufficient -
4. Re: Bundle.start() does not transition to ACTIVE
alesj Aug 24, 2009 10:22 AM (in response to thomas.diesler)"thomas.diesler@jboss.com" wrote:
I fixed by only adding PackageRequirement for packages that are not system and not exported.
This looks like a hack, at least the "not exported" part.
Where it might make sense for system stuff, which doesn't go over MC's CLDescribe deployer,
hence not describing its exporting packages --> making sense to exclude them.
But I don't see why this would be useful for imports?
The imports are declarative info, so why should it be excluded if it's also found in exports? -
5. Re: Bundle.start() does not transition to ACTIVE
thomas.diesler Aug 24, 2009 10:29 AM (in response to thomas.diesler)Yes, I agree.
The OSGiBundleClassLoadingDeployer currently contains this TODO// [TODO] Import package requirements should probably resolve against export capabilities boolean isExportPackage = exportedNames.contains(packageName);
The configured system packages are now set as a filter on the parent domain. Please see OSGiClassLoaderSystem for details. -
6. Re: Bundle.start() does not transition to ACTIVE
adrian.brock Aug 25, 2009 9:40 AM (in response to thomas.diesler)I'd actually already fixed this TODO, but not committed it yet.
The issue is more general than your fix. My fix is to checkIncomplete()
on the deployment since there are other things besides missing dependencies that
can cause the bundle not to start.