From 3f7ff24624718b21673d5177d128eec79b0c30e2 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Fri, 9 Nov 2012 11:06:17 +0000 Subject: [PATCH] Fix issue sin osgi boot git-svn-id: https://svn.argeo.org/commons/trunk@5766 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- .../main/java/org/argeo/osgi/boot/OsgiBoot.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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=" -- 2.30.2