aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mnutt...@apache.org
Subject svn commit: r1625637 - /aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java
Date Wed, 17 Sep 2014 15:56:53 GMT
Author: mnuttall
Date: Wed Sep 17 15:56:53 2014
New Revision: 1625637

URL: http://svn.apache.org/r1625637
Log:
Aries-1245: SubsystemException: Framework could not resolve the bundles - from a patch by
Tom Evans

Modified:
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java?rev=1625637&r1=1625636&r2=1625637&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java
(original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java
Wed Sep 17 15:56:53 2014
@@ -158,16 +158,26 @@ public class StartAction extends Abstrac
 			if (!subsystem.isRoot()) {
 				for (Subsystem child : Activator.getInstance().getSubsystems().getChildren(subsystem))
 					resolve((BasicSubsystem)child);
+				
+				FrameworkWiring frameworkWiring = Activator.getInstance().getBundleContext().getBundle(0)
+						.adapt(FrameworkWiring.class);
+
 				// TODO I think this is insufficient. Do we need both
 				// pre-install and post-install environments for the Resolver?
 				Collection<Bundle> bundles = getBundles(subsystem);
-				if (!Activator.getInstance().getBundleContext().getBundle(0)
-						.adapt(FrameworkWiring.class).resolveBundles(bundles)) {
+				if (!frameworkWiring.resolveBundles(bundles)) {
+					//work out which bundles could not be resolved
+					Collection<Bundle> unresolved = new ArrayList<Bundle>();
+					for(Bundle bundle:bundles){
+						if((bundle.getState() & Bundle.RESOLVED) != Bundle.RESOLVED){
+							unresolved.add(bundle);
+						}
+					}
 					logger.error(
 							"Unable to resolve bundles for subsystem/version/id {}/{}/{}: {}",
 							new Object[] { subsystem.getSymbolicName(), subsystem.getVersion(),
-									subsystem.getSubsystemId(), bundles });
-					throw new SubsystemException("Framework could not resolve the bundles");
+									subsystem.getSubsystemId(), unresolved });
+					throw new SubsystemException("Framework could not resolve the bundles: " + unresolved);
 				}
 				setExportIsolationPolicy(subsystem);
 			}



Mime
View raw message