From: Mathieu Baudier Date: Fri, 9 Nov 2012 11:06:17 +0000 (+0000) Subject: Fix issue sin osgi boot X-Git-Tag: argeo-commons-2.1.30~762 X-Git-Url: https://git.argeo.org/?a=commitdiff_plain;h=3f7ff24624718b21673d5177d128eec79b0c30e2;p=lgpl%2Fargeo-commons.git Fix issue sin osgi boot git-svn-id: https://svn.argeo.org/commons/trunk@5766 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/base/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java b/base/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java index 8d07219df..2015f7504 100644 --- a/base/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java +++ b/base/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java @@ -274,9 +274,9 @@ public class OsgiBoot { public void startBundles() { // default and active start levels from System properties Integer defaultStartLevel = new Integer(Integer.parseInt(OsgiBootUtils - .getProperty(PROP_OSGI_BUNDLES_DEFAULTSTARTLEVEL))); - Integer activeStartLevel = new Integer( - OsgiBootUtils.getProperty(PROP_OSGI_STARTLEVEL)); + .getProperty(PROP_OSGI_BUNDLES_DEFAULTSTARTLEVEL, "4"))); + Integer activeStartLevel = new Integer(OsgiBootUtils.getProperty( + PROP_OSGI_STARTLEVEL, "6")); SortedMap/* > */startLevels = new TreeMap(); computeStartLevels(startLevels, System.getProperties(), @@ -414,11 +414,12 @@ public class OsgiBoot { // monitors that all bundles are started long beginMonitor = System.currentTimeMillis(); - boolean allStarted = false; + boolean allStarted = !(startedBundles.size() > 0); List/* */notStarted = new ArrayList(); - while (allStarted - && (System.currentTimeMillis() - beginMonitor) > defaultTimeout) { + while (!allStarted + && (System.currentTimeMillis() - beginMonitor) < defaultTimeout) { notStarted = new ArrayList(); + allStarted = true; for (int i = 0; i < startedBundles.size(); i++) { Bundle bundle = (Bundle) startedBundles.get(i); // TODO check behaviour of lazs bundles @@ -516,7 +517,7 @@ public class OsgiBoot { int currentState = bundle.getState(); while (!(currentState == Bundle.RESOLVED || currentState == Bundle.ACTIVE)) { long now = System.currentTimeMillis(); - if ((now - startBegin) > defaultTimeout) + if ((now - startBegin) > defaultTimeout * 10) throw new Exception("Bundle " + bundle.getSymbolicName() + " was not RESOLVED or ACTIVE after " + (now - startBegin) + "ms (originalState="