Try to start unresolved bundles
authorMathieu Baudier <mbaudier@argeo.org>
Tue, 30 May 2023 11:47:58 +0000 (13:47 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Tue, 30 May 2023 11:47:58 +0000 (13:47 +0200)
org.argeo.init/src/org/argeo/init/osgi/OsgiBootDiagnostics.java

index 72d9a3e64f683b991530e5132c2bce07fcc78529..b56b6b070abe7908df3059327573a90d5f54af0b 100644 (file)
@@ -21,6 +21,7 @@ class OsgiBootDiagnostics {
        public OsgiBootDiagnostics(BundleContext bundleContext) {
                this.bundleContext = bundleContext;
        }
+
        /*
         * DIAGNOSTICS
         */
@@ -42,6 +43,17 @@ class OsgiBootDiagnostics {
                if (unresolvedBundles.size() != 0) {
                        OsgiBootUtils.warn("Unresolved bundles " + unresolvedBundles);
                }
+
+               // try to start unresolved bundles in order to trigger diagnostics
+               // (this should not have side-effects since unresolved bundles won't be able to
+               // start)
+               for (Bundle b : unresolvedBundles) {
+                       try {
+                               b.start();
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+               }
        }
 
        /** List packages exported twice. */