Merge remote-tracking branch 'origin/master'
diff --git a/protocols/bundles/ch.ethz.iks.r_osgi.remote/META-INF/MANIFEST.MF b/protocols/bundles/ch.ethz.iks.r_osgi.remote/META-INF/MANIFEST.MF
index 5e696b2..49f53cf 100644
--- a/protocols/bundles/ch.ethz.iks.r_osgi.remote/META-INF/MANIFEST.MF
+++ b/protocols/bundles/ch.ethz.iks.r_osgi.remote/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin.name
 Bundle-SymbolicName: ch.ethz.iks.r_osgi.remote
-Bundle-Version: 1.0.6.RC1_qualifier
+Bundle-Version: 1.0.7.RC1_qualifier
 Bundle-Vendor: %plugin.provider
 Import-Package: org.objectweb.asm;version="[5.0.1,6.0.0)",
  org.osgi.framework,
diff --git a/protocols/bundles/ch.ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/r_osgi/impl/RemoteOSGiActivator.java b/protocols/bundles/ch.ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/r_osgi/impl/RemoteOSGiActivator.java
index 4c8a171..fcfdc9f 100644
--- a/protocols/bundles/ch.ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/r_osgi/impl/RemoteOSGiActivator.java
+++ b/protocols/bundles/ch.ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/r_osgi/impl/RemoteOSGiActivator.java
@@ -31,7 +31,6 @@
 import java.util.Dictionary;
 import java.util.Hashtable;
 
-import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -49,7 +48,6 @@
  */
 public final class RemoteOSGiActivator implements BundleActivator {
 
-	private static final boolean DELETE_PROXY_BUNDLES_ON_INIT = new Boolean(System.getProperty("ch.ethz.iks.r_osgi.deleteProxyBundlesOnInit","true")).booleanValue();
 	/**
 	 * the Remote OSGi service instance.
 	 */
@@ -87,9 +85,6 @@
 			RemoteOSGiServiceImpl.log = (LogService) context.getService(logRef);
 		}
 
-		if (DELETE_PROXY_BUNDLES_ON_INIT)
-			deleteProxyBundles(context);
-		
 		if (remoting == null) {
 			// get the instance of RemoteOSGiServiceImpl
 			remoting = new RemoteOSGiServiceImpl();
@@ -112,20 +107,6 @@
 		}
 	}
 
-	private void deleteProxyBundles(BundleContext context) {
-		Bundle[] bundles = context.getBundles();
-		for(int i=0; i < bundles.length; i++) {
-			Bundle b = bundles[i];
-			String bName = b.getSymbolicName();
-			if (bName.startsWith("R-OSGi Proxy Bundle generated for Endpoint")) 
-				try {
-					b.uninstall();
-				} catch (Exception e) {
-					if (RemoteOSGiServiceImpl.log != null) 
-						RemoteOSGiServiceImpl.log.log(LogService.LOG_WARNING, "Could not uninstall proxy bundle name="+bName);
-				}
-		}
-	}
 	/**
 	 * called when the bundle is stopped.
 	 * 
diff --git a/providers/bundles/org.eclipse.ecf.provider.r_osgi/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.r_osgi/META-INF/MANIFEST.MF
index 511836b..986c7d1 100644
--- a/providers/bundles/org.eclipse.ecf.provider.r_osgi/META-INF/MANIFEST.MF
+++ b/providers/bundles/org.eclipse.ecf.provider.r_osgi/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin.name
 Bundle-SymbolicName: org.eclipse.ecf.provider.r_osgi;singleton:=true
-Bundle-Version: 3.5.300.qualifier
+Bundle-Version: 3.5.400.qualifier
 Import-Package: org.eclipse.ecf.core.util.reflection,
  org.eclipse.ecf.remoteservice.asyncproxy;version="1.0.0",
  org.eclipse.equinox.concurrent.future;version="1.0.0",
diff --git a/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/Activator.java b/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/Activator.java
index 40375fa..a1362a8 100644
--- a/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/Activator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/Activator.java
@@ -39,6 +39,9 @@
 	// 
 	public static final String CONSUMER_SYNC_EXECUTOR_TYPE = "org.eclipse.ecf.provider.r_osgi.consumerExecutor"; //$NON-NLS-1$
 
+	// see bug 495535
+	private static final boolean DELETE_PROXY_BUNDLES_ON_INIT = new Boolean(System.getProperty("ch.ethz.iks.r_osgi.deleteProxyBundlesOnInit", "true")).booleanValue(); //$NON-NLS-1$ //$NON-NLS-2$
+
 	// The plug-in ID
 	public static final String PLUGIN_ID = "org.eclipse.ecf.provider.r_osgi"; //$NON-NLS-1$
 
@@ -69,6 +72,11 @@
 		this.context = bc;
 		r_osgi_tracker = new ServiceTracker(context, RemoteOSGiService.class.getName(), null);
 		r_osgi_tracker.open();
+
+		// bug 495535
+		if (DELETE_PROXY_BUNDLES_ON_INIT)
+			deleteProxyBundles();
+
 		SafeRunner.run(new ExtensionRegistryRunnable(bc) {
 			protected void runWithoutRegistry() throws Exception {
 				bc.registerService(Namespace.class, new R_OSGiNamespace(), null);
@@ -82,6 +90,20 @@
 		});
 	}
 
+	private void deleteProxyBundles() {
+		Bundle[] bundles = context.getBundles();
+		for (int i = 0; i < bundles.length; i++) {
+			Bundle b = bundles[i];
+			String bName = b.getSymbolicName();
+			if (bName.startsWith("R-OSGi Proxy Bundle generated for Endpoint")) //$NON-NLS-1$
+				try {
+					b.uninstall();
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+		}
+	}
+
 	/**
 	 * Called when the OSGi framework stops the bundle.
 	 *