Index: src/main/java/org/apache/karaf/main/Main.java =================================================================== --- src/main/java/org/apache/karaf/main/Main.java (revision 987102) +++ src/main/java/org/apache/karaf/main/Main.java (working copy) @@ -226,10 +226,10 @@ configProps.setProperty(Constants.FRAMEWORK_STORAGE, storage.getAbsolutePath()); } - defaultStartLevel = Integer.parseInt(configProps.getProperty(Constants.FRAMEWORK_BEGINNING_STARTLEVEL)); - lockStartLevel = Integer.parseInt(configProps.getProperty(PROPERTY_LOCK_LEVEL, Integer.toString(lockStartLevel))); - lockDelay = Integer.parseInt(configProps.getProperty(PROPERTY_LOCK_DELAY, Integer.toString(lockDelay))); - configProps.setProperty(Constants.FRAMEWORK_BEGINNING_STARTLEVEL, Integer.toString(lockStartLevel)); + defaultStartLevel = Integer.parseInt(configProps.getProperty(Constants.FRAMEWORK_BEGINNING_STARTLEVEL).trim()); + lockStartLevel = Integer.parseInt(configProps.getProperty(PROPERTY_LOCK_LEVEL, Integer.toString(lockStartLevel)).trim()); + lockDelay = Integer.parseInt(configProps.getProperty(PROPERTY_LOCK_DELAY, Integer.toString(lockDelay)).trim()); + configProps.setProperty(Constants.FRAMEWORK_BEGINNING_STARTLEVEL, Integer.toString(lockStartLevel).trim()); // Start up the OSGI framework InputStream is = getClass().getResourceAsStream("/META-INF/services/" + FrameworkFactory.class.getName()); @@ -368,7 +368,7 @@ } private static void processSecurityProperties(Properties m_configProps) { - String prop = m_configProps.getProperty("org.apache.karaf.security.providers"); + String prop = m_configProps.getProperty("org.apache.karaf.security.providers").trim(); if (prop != null) { String[] providers = prop.split(","); for (String provider : providers) { @@ -449,7 +449,7 @@ */ private void processAutoProperties(BundleContext context) { // Check if we want to convert URLs to maven style - boolean convertToMavenUrls = Boolean.parseBoolean(configProps.getProperty(PROPERTY_CONVERT_TO_MAVEN_URL, "true")); + boolean convertToMavenUrls = Boolean.parseBoolean(configProps.getProperty(PROPERTY_CONVERT_TO_MAVEN_URL, "true").trim()); // Retrieve the Start Level service, since it will be needed // to set the start level of the installed bundles. @@ -459,7 +459,7 @@ // Set the default bundle start level int ibsl = 60; try { - String str = configProps.getProperty("karaf.startlevel.bundle"); + String str = configProps.getProperty("karaf.startlevel.bundle").trim(); if (str != null) { ibsl = Integer.parseInt(str); } @@ -514,7 +514,7 @@ System.err.println("Invalid property: " + key); } } - autoStart.put(startLevel, configProps.getProperty(key)); + autoStart.put(startLevel, configProps.getProperty(key).trim()); } for (Integer startLevel : autoStart.keySet()) { StringTokenizer st = new StringTokenizer(autoStart.get(startLevel), "\" ", true); @@ -747,7 +747,7 @@ bundleDirs.add(new File(karafHome, defaultRepo)); } - String locations = configProps.getProperty(BUNDLE_LOCATIONS); + String locations = configProps.getProperty(BUNDLE_LOCATIONS).trim(); if (locations != null) { StringTokenizer st = new StringTokenizer(locations, "\" ", true); @@ -780,7 +780,7 @@ for (Enumeration e = configProps.propertyNames(); e.hasMoreElements();) { String name = (String) e.nextElement(); configProps.setProperty(name, - substVars(configProps.getProperty(name), name, null, configProps)); + substVars(configProps.getProperty(name).trim(), name, null, configProps)); } // Mutate properties @@ -817,7 +817,7 @@ // Nothing we can do. } } - String includes = configProps.getProperty(INCLUDES_PROPERTY); + String includes = configProps.getProperty(INCLUDES_PROPERTY).trim(); if (includes != null) { StringTokenizer st = new StringTokenizer(includes, "\" ", true); if (st.countTokens() > 0) { @@ -850,7 +850,7 @@ } private void updateClassLoader(Properties configProps) throws Exception { - String framework = configProps.getProperty(KARAF_FRAMEWORK); + String framework = configProps.getProperty(KARAF_FRAMEWORK).trim(); if (framework == null) { throw new IllegalArgumentException("Property " + KARAF_FRAMEWORK + " must be set in the etc/" + CONFIG_PROPERTIES_FILE_NAME + " configuration file"); }