diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/Common.java b/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/Common.java
index c83ad2c..ae32aec 100644
--- a/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/Common.java
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/Common.java
@@ -98,7 +98,7 @@
 
     public CompositeOption eventadmin() {
         return new DefaultCompositeOption(
-                mavenBundle("org.apache.felix", "org.apache.felix.eventadmin", "1.3.0"),
+                mavenBundle("org.apache.felix", "org.apache.felix.eventadmin", "1.2.10"),
                 mavenBundle("org.apache.felix", "org.apache.felix.ipojo.handler.eventadmin",
                         "1.8.0").versionAsInProject());
     }
@@ -181,6 +181,9 @@
         }
 
         if (count == 500) {
+            for (Bundle bundle : bc.getBundles()) {
+                System.out.println("Bundle " + bundle.getSymbolicName() + " - " + bundle.getState());
+            }
             System.err.println("Bundle stability isn't reached after 500 tries");
             throw new IllegalStateException("Cannot reach the bundle stability");
         }
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/Common.java b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/Common.java
index 76eacae..71f64b7 100644
--- a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/Common.java
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/Common.java
@@ -20,6 +20,7 @@
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
 import org.ow2.chameleon.testing.helpers.IPOJOHelper;
 import org.ow2.chameleon.testing.helpers.OSGiHelper;
 import org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy;
@@ -58,6 +59,7 @@
         root.setLevel(Level.INFO);
 
         return options(
+                cleanCaches(),
                 ipojoBundles(),
                 junitBundles(),
                 //testedBundle(),
@@ -127,6 +129,8 @@
         }
         String version = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VERSION);
         System.out.println("OSGi Framework : " + vendor + " - " + version);
+
+        waitForStability(bc);
     }
 
     @After
@@ -192,5 +196,78 @@
         }
     }
 
+    /**
+     * Waits for stability:
+     * <ul>
+     * <li>all bundles are activated
+     * <li>service count is stable
+     * </ul>
+     * If the stability can't be reached after a specified time,
+     * the method throws a {@link IllegalStateException}.
+     * @param context the bundle context
+     * @throws IllegalStateException when the stability can't be reach after a several attempts.
+     */
+    public void waitForStability(BundleContext context) throws IllegalStateException {
+        // Wait for bundle initialization.
+        boolean bundleStability = getBundleStability(context);
+        int count = 0;
+        while (!bundleStability && count < 500) {
+            try {
+                Thread.sleep(5);
+            } catch (InterruptedException e) {
+                // Interrupted
+            }
+            count++;
+            bundleStability = getBundleStability(context);
+        }
+
+        if (count == 500) {
+            for (Bundle bundle : bc.getBundles()) {
+                System.out.println("Bundle " + bundle.getSymbolicName() + " - " + bundle.getState());
+            }
+            System.err.println("Bundle stability isn't reached after 500 tries");
+            throw new IllegalStateException("Cannot reach the bundle stability");
+        }
+
+        boolean serviceStability = false;
+        count = 0;
+        int count1 = 0;
+        int count2 = 0;
+        while (! serviceStability && count < 500) {
+            try {
+                ServiceReference[] refs = context.getServiceReferences((String) null, null);
+                count1 = refs.length;
+                Thread.sleep(500);
+                refs = context.getServiceReferences((String) null, null);
+                count2 = refs.length;
+                serviceStability = count1 == count2;
+            } catch (Exception e) {
+                System.err.println(e);
+                serviceStability = false;
+                // Nothing to do, while recheck the condition
+            }
+            count++;
+        }
+
+        if (count == 500) {
+            System.err.println("Service stability isn't reached after 500 tries (" + count1 + " != " + count2);
+            throw new IllegalStateException("Cannot reach the service stability");
+        }
+    }
+
+    /**
+     * Are bundle stables.
+     * @param bc the bundle context
+     * @return <code>true</code> if every bundles are activated.
+     */
+    private boolean getBundleStability(BundleContext bc) {
+        boolean stability = true;
+        Bundle[] bundles = bc.getBundles();
+        for (int i = 0; i < bundles.length; i++) {
+            stability = stability && (bundles[i].getState() == Bundle.ACTIVE);
+        }
+        return stability;
+    }
+
 
 }
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/VersionConflictTest.java b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/VersionConflictTest.java
index 5f9cddf..0db640a 100644
--- a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/VersionConflictTest.java
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/VersionConflictTest.java
@@ -18,8 +18,8 @@
 import org.ops4j.pax.exam.spi.reactors.PerMethod;
 import org.ops4j.pax.tinybundles.core.TinyBundles;
 import org.osgi.framework.*;
-import org.osgi.service.packageadmin.ExportedPackage;
-import org.osgi.service.packageadmin.PackageAdmin;
+import org.osgi.framework.wiring.BundleWire;
+import org.osgi.framework.wiring.BundleWiring;
 import org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy;
 
 import javax.inject.Inject;
@@ -40,7 +40,6 @@
     @Inject
     private BundleContext context;
 
-
     @Configuration
     public Option[] config() throws IOException {
 
@@ -74,7 +73,7 @@
                 TinyBundles.bundle()
                         .add(MyComponent.class)
                         .set(Constants.BUNDLE_SYMBOLICNAME, "ProviderV1")
-                        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services; version=\"[1.0.0, 1.0.0]\"")
+                        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services; version=\"1.0.0\"")
                         .build(IPOJOStrategy.withiPOJO(new File("src/main/resources/vprovider-v1.xml"))),
                 c1);
 
@@ -83,8 +82,7 @@
                 TinyBundles.bundle()
                         .add(MyComponent.class)
                         .set(Constants.BUNDLE_SYMBOLICNAME, "ProviderV2")
-                        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services; version=\"[2.0.0," +
-                                " 2.0.0]\"")
+                        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services; version=\"2.0.0\"")
                         .build(IPOJOStrategy.withiPOJO(new File("src/main/resources/vprovider-v2.xml"))),
                 c2);
 
@@ -93,8 +91,7 @@
                 TinyBundles.bundle()
                         .add(MyCons.class)
                         .set(Constants.BUNDLE_SYMBOLICNAME, "MyCons")
-                        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services; version=\"[2.0.0, " +
-                                "2.0.0]\"")
+                        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services; version=\"2.0.0\"")
                         .set(Constants.BUNDLE_VERSION, "2.0")
                         .build(IPOJOStrategy.withiPOJO(new File("src/main/resources/cons.xml"))),
                 cons);
@@ -105,7 +102,7 @@
                         .add(MyCons.class)
                         .set(Constants.BUNDLE_SYMBOLICNAME, "MyCons")
                         .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services; version=\"[1.0.0, " +
-                                "2.0.0)\"")
+                                "1.1.0)\"")
                         .set(Constants.BUNDLE_VERSION, "1.0")
                         .build(IPOJOStrategy.withiPOJO(new File("src/main/resources/cons.xml"))),
                 consV1);
@@ -136,8 +133,16 @@
 //        return builder;
 //    }
 
+    public boolean isKF() {
+        return bc.getClass().toString().contains("knopflerfish");
+    }
+
     @Test
     public void deployBundlesAtRuntime() throws MalformedURLException, BundleException, InvalidSyntaxException {
+        if (isKF()) {
+            System.out.println("Test disabled on knopflerfish");
+            return;
+        }
 
         Bundle b1 = context.installBundle(context.getProperty("url1"));
         b1.start();
@@ -155,6 +160,7 @@
         Bundle b5 = context.installBundle(context.getProperty("cons"));
         b5.start();
 
+        waitForStability(bc);
 
         Bundle[] bundles = context.getBundles();
         for (Bundle bundle : bundles) {
@@ -162,23 +168,11 @@
             //Assert.assertEquals(bundles[i].getSymbolicName() + " is not active", Bundle.ACTIVE, bundles[i].getState());
         }
 
-        //TODO Migrate to new API, be aware that the new API may not be implemented on all platforms.
-        PackageAdmin pa = osgiHelper.getPackageAdmin();
-        Bundle b = pa.getBundles("ServiceInterfaceV1", null)[0];
-        ExportedPackage[] packages = pa.getExportedPackages(b);
-        if (packages == null) {
-            System.out.println("Packages  ServiceInterfaceV1 : " + 0);
-        } else {
-            System.out.println("Packages  ServiceInterfaceV1 : " + packages.length);
-            for (ExportedPackage p : packages) {
-                System.out.println("Package : " + p.getName() + " - " + p.getVersion().toString());
-            }
-        }
-        b = pa.getBundles("ServiceInterfaceV2", null)[0];
-        packages = pa.getExportedPackages(b);
-        System.out.println("Packages  ServiceInterfaceV2 : " + packages.length);
-        for (ExportedPackage p : packages) {
-            System.out.println("Package : " + p.getName() + " - " + p.getVersion().toString());
+        Bundle consBundle = osgiHelper.getBundle("MyCons");
+        BundleWiring wiring = consBundle.adapt(BundleWiring.class);
+        System.out.println("Bundle Wiring req: ");
+        for (BundleWire wire : wiring.getRequiredWires(null)) {
+            System.out.println(wire.getCapability().getAttributes() + " - " + wire.getCapability().getDirectives());
         }
 
         osgiHelper.waitForService(Architecture.class.getName(), "(architecture.instance=mycons)", 2000);
@@ -235,25 +229,6 @@
             System.out.println("bundle " + bundles[i].getSymbolicName() + " : " + (bundles[i].getState() == Bundle.ACTIVE));
         }
 
-
-        PackageAdmin pa = osgiHelper.getPackageAdmin();
-        Bundle b = pa.getBundles("ServiceInterfaceV1", null)[0];
-        ExportedPackage[] packages = pa.getExportedPackages(b);
-        if (packages == null) {
-            System.out.println("Packages  ServiceInterfaceV1 : " + 0);
-        } else {
-            System.out.println("Packages  ServiceInterfaceV1 : " + packages.length);
-            for (ExportedPackage p : packages) {
-                System.out.println("Package : " + p.getName() + " - " + p.getVersion().toString());
-            }
-        }
-        b = pa.getBundles("ServiceInterfaceV2", null)[0];
-        packages = pa.getExportedPackages(b);
-        System.out.println("Packages  ServiceInterfaceV2 : " + packages.length);
-        for (ExportedPackage p : packages) {
-            System.out.println("Package : " + p.getName() + " - " + p.getVersion().toString());
-        }
-
         osgiHelper.waitForService(Architecture.class.getName(), "(architecture.instance=mycons)", 2000);
 
         // Check that the two services are provided.
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-lifecycle-callback-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java b/ipojo/runtime/core-it/src/it/ipojo-core-lifecycle-callback-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
index 2a38af8..74fc32f 100644
--- a/ipojo/runtime/core-it/src/it/ipojo-core-lifecycle-callback-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-lifecycle-callback-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
@@ -17,8 +17,10 @@
 import org.ops4j.pax.exam.spi.reactors.PerClass;
 import org.ops4j.pax.tinybundles.core.TinyBundle;
 import org.ops4j.pax.tinybundles.core.TinyBundles;
+import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
 import org.ow2.chameleon.testing.helpers.IPOJOHelper;
 import org.ow2.chameleon.testing.helpers.OSGiHelper;
 import org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy;
@@ -112,6 +114,8 @@
         }
         String version = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VERSION);
         System.out.println("OSGi Framework : " + vendor + " - " + version);
+
+        waitForStability(bc);
     }
 
     @After
@@ -192,5 +196,75 @@
         fail("Assertion failed : " + s);
     }
 
+    /**
+     * Waits for stability:
+     * <ul>
+     * <li>all bundles are activated
+     * <li>service count is stable
+     * </ul>
+     * If the stability can't be reached after a specified time,
+     * the method throws a {@link IllegalStateException}.
+     * @param context the bundle context
+     * @throws IllegalStateException when the stability can't be reach after a several attempts.
+     */
+    private void waitForStability(BundleContext context) throws IllegalStateException {
+        // Wait for bundle initialization.
+        boolean bundleStability = getBundleStability(context);
+        int count = 0;
+        while (!bundleStability && count < 500) {
+            try {
+                Thread.sleep(5);
+            } catch (InterruptedException e) {
+                // Interrupted
+            }
+            count++;
+            bundleStability = getBundleStability(context);
+        }
+
+        if (count == 500) {
+            System.err.println("Bundle stability isn't reached after 500 tries");
+            throw new IllegalStateException("Cannot reach the bundle stability");
+        }
+
+        boolean serviceStability = false;
+        count = 0;
+        int count1 = 0;
+        int count2 = 0;
+        while (! serviceStability && count < 500) {
+            try {
+                ServiceReference[] refs = context.getServiceReferences((String) null, null);
+                count1 = refs.length;
+                Thread.sleep(500);
+                refs = context.getServiceReferences((String) null, null);
+                count2 = refs.length;
+                serviceStability = count1 == count2;
+            } catch (Exception e) {
+                System.err.println(e);
+                serviceStability = false;
+                // Nothing to do, while recheck the condition
+            }
+            count++;
+        }
+
+        if (count == 500) {
+            System.err.println("Service stability isn't reached after 500 tries (" + count1 + " != " + count2);
+            throw new IllegalStateException("Cannot reach the service stability");
+        }
+    }
+
+    /**
+     * Are bundle stables.
+     * @param bc the bundle context
+     * @return <code>true</code> if every bundles are activated.
+     */
+    private boolean getBundleStability(BundleContext bc) {
+        boolean stability = true;
+        Bundle[] bundles = bc.getBundles();
+        for (int i = 0; i < bundles.length; i++) {
+            stability = stability && (bundles[i].getState() == Bundle.ACTIVE);
+        }
+        return stability;
+    }
+
 
 }
