diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/pom.xml b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/pom.xml
new file mode 100644
index 0000000..a1bef03
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/pom.xml
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <parent>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>org.apache.felix.ipojo.runtime.core-it</artifactId>
+        <version>1.9.0-SNAPSHOT</version>
+        <relativePath>../../../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.apache.felix</groupId>
+    <artifactId>ipojo-core-bad-configuration-test</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+    <name>${project.artifactId}</name>
+
+    <properties>
+        <exam.version>3.0.0</exam.version>
+        <url.version>1.5.1</url.version>
+    </properties>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-native</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit4</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-link-mvn</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-aether</artifactId>
+            <version>${url.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.framework</artifactId>
+            <version>4.2.0</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+            <version>0.9.6</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <version>0.9.6</version>
+            <scope>test</scope>
+        </dependency>
+
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.9</version>
+            <scope>test</scope>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.ops4j.pax.tinybundles</groupId>
+            <artifactId>tinybundles</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.ipojo</artifactId>
+            <version>1.9.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.ipojo.manipulator</artifactId>
+            <version>1.9.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ow2.chameleon.testing</groupId>
+            <artifactId>osgi-helpers</artifactId>
+            <version>0.6.0</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ow2.chameleon.testing</groupId>
+            <artifactId>tinybundles-ipojo</artifactId>
+            <version>0.3.0</version>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.5.1</version>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.servicemix.tooling</groupId>
+                <artifactId>depends-maven-plugin</artifactId>
+                <version>1.2</version>
+                <executions>
+                    <execution>
+                        <id>generate-config</id>
+                        <goals>
+                            <goal>generate-depends-file</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    
+</project>
\ No newline at end of file
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/BadConstructors.java b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/BadConstructors.java
new file mode 100644
index 0000000..a23588f
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/BadConstructors.java
@@ -0,0 +1,21 @@
+package org.apache.felix.ipojo.runtime.bad.components;
+
+public class BadConstructors {
+    
+    public BadConstructors() {
+        throw new Error("BAD");
+    }
+    
+    public BadConstructors(int i) {
+        // DO NOTHING
+    }
+    
+    public static BadConstructors createBad() {
+        throw new RuntimeException("BAD");
+    }
+    
+    public static BadConstructors createBad2(int o) {
+        return new BadConstructors(o);
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/CallbackCheckService.java b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/CallbackCheckService.java
new file mode 100644
index 0000000..b8cc4b6
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/CallbackCheckService.java
@@ -0,0 +1,68 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.bad.components;
+
+import org.apache.felix.ipojo.runtime.bad.services.CheckService;
+import org.apache.felix.ipojo.runtime.bad.services.FooService;
+
+import java.util.Properties;
+
+public class CallbackCheckService extends ParentClass implements CheckService {
+
+    int i = 0;
+
+    FooService fs;
+
+    public static CallbackCheckService singleton;
+
+    public static int count = 0;
+
+    private static CallbackCheckService singleton() {
+        if (singleton == null) {
+            count++;
+            singleton = new CallbackCheckService();
+        }
+        return singleton;
+    }
+
+    public static CallbackCheckService several() {
+        count++;
+        return new CallbackCheckService();
+    }
+
+    private void start() {
+        i++;
+    }
+
+    protected void stop() {
+        i++;
+    }
+
+    public boolean check() {
+        return fs.foo();
+    }
+
+    public Properties getProps() {
+        Properties p = new Properties();
+        p.put("int", new Integer(i));
+        p.put("count", new Integer(count));
+        return p;
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/CheckProviderParentClass.java b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/CheckProviderParentClass.java
new file mode 100644
index 0000000..98fd637
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/CheckProviderParentClass.java
@@ -0,0 +1,51 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.bad.components;
+
+import org.apache.felix.ipojo.runtime.bad.services.FooService;
+import org.osgi.framework.ServiceReference;
+
+public abstract class CheckProviderParentClass {
+    
+    int simpleU = 0;
+    int objectU = 0;
+    int refU = 0;
+    int bothU = 0;
+    
+    
+    public void bothUnbind(FooService o, ServiceReference sr) {
+        if(sr != null && o != null && o instanceof FooService) { bothU++; }
+    }
+    
+    public void refUnbind(ServiceReference sr) {
+        if(sr != null) { refU++; }
+    }
+    
+    public void objectUnbind(FooService o) {
+        if(o != null && o instanceof FooService) { objectU++; }
+        else {
+            System.err.println("Unbind null : " + o);
+        }
+    }
+    
+    public void voidUnbind() {
+        simpleU++;
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/CheckServiceProvider.java b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/CheckServiceProvider.java
new file mode 100644
index 0000000..dfe1e7a
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/CheckServiceProvider.java
@@ -0,0 +1,83 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.bad.components;
+
+import org.apache.felix.ipojo.runtime.bad.services.CheckService;
+import org.apache.felix.ipojo.runtime.bad.services.FooService;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+
+public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
+    
+	FooService fs;
+	
+	int simpleB = 0;
+	int objectB = 0;
+	int refB = 0;
+	int bothB = 0;
+
+	public boolean check() {
+		return fs.foo();
+	}
+
+	public Properties getProps() {
+		Properties props = new Properties();
+		props.put("voidB", new Integer(simpleB));
+		props.put("objectB", new Integer(objectB));
+		props.put("refB", new Integer(refB));
+		props.put("bothB", new Integer(bothB));
+		props.put("voidU", new Integer(simpleU));
+		props.put("objectU", new Integer(objectU));
+		props.put("refU", new Integer(refU));
+		props.put("bothU", new Integer(bothU));
+		if (fs != null) {
+		    props.put("result", new Boolean(fs.foo()));
+		    props.put("boolean", new Boolean(fs.getBoolean()));
+		    props.put("int", new Integer(fs.getInt()));
+		    props.put("long", new Long(fs.getLong()));
+		    props.put("double", new Double(fs.getDouble()));
+		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }
+		}
+        props.put("static", CheckService.foo);
+        props.put("class", CheckService.class.getName());
+		return props;
+	}
+	
+	private void voidBind() {
+		simpleB++;
+	}
+	
+	protected void objectBind(FooService o) {
+	    if (o == null) {
+	        System.err.println("Bind receive null !!! ");
+	        return;
+	    }
+		if(o != null && o instanceof FooService) { objectB++; }
+	}
+	
+	public void refBind(ServiceReference sr) {
+		if(sr != null) { refB++; }
+	}
+	
+    public void bothBind(FooService o, ServiceReference sr) {
+	    if(sr != null && o != null && o instanceof FooService) { bothB++; }
+	}
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/LifecycleControllerTest.java b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/LifecycleControllerTest.java
new file mode 100644
index 0000000..0ad1c4f
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/LifecycleControllerTest.java
@@ -0,0 +1,49 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.bad.components;
+
+import org.apache.felix.ipojo.runtime.bad.services.CheckService;
+
+import java.util.Properties;
+
+public class LifecycleControllerTest implements CheckService {
+    
+    private boolean m_state = true;
+    private String m_conf;
+    
+    public void setConf(String newConf) {
+        if (newConf.equals("foo")) {
+            m_state = true;
+        } else {
+            m_state = false;
+        }
+    }
+
+    public boolean check() {
+        return m_state;
+    }
+
+    public Properties getProps() {
+       Properties props = new Properties();
+       props.put("conf", m_conf);
+       props.put("state", new Boolean(m_state));
+       return props;
+    }
+}
+
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/ParentClass.java b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/ParentClass.java
new file mode 100644
index 0000000..557c2ea
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/components/ParentClass.java
@@ -0,0 +1,51 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.bad.components;
+
+public class ParentClass {
+    
+    public void parentStart() {
+        
+    }
+    
+    public void parentStop() {
+        
+    }
+	
+	protected String[] strings;
+	
+	protected String string;
+	
+	protected int upStrings;
+	
+	protected int upString;
+	
+	public void updateStrings(String[] bb) {
+        strings = bb;
+        upStrings++;
+    }
+    
+    public void updateString(String bb) {
+        string = bb;
+        upString++;
+    }
+	
+	
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/services/BarService.java b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/services/BarService.java
new file mode 100644
index 0000000..89c4614
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/services/BarService.java
@@ -0,0 +1,29 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.bad.services;
+
+import java.util.Properties;
+
+public interface BarService {
+	
+	public boolean bar();
+	
+	public Properties getProps();
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/services/CheckService.java b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/services/CheckService.java
new file mode 100644
index 0000000..df9aedf
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/services/CheckService.java
@@ -0,0 +1,31 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.bad.services;
+
+import java.util.Properties;
+
+public interface CheckService {
+    
+    public static final String foo = "foo";
+	
+	public boolean check();
+	
+	public Properties getProps();
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/services/FooService.java b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/services/FooService.java
new file mode 100644
index 0000000..84ba216
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/java/org/apache/felix/ipojo/runtime/bad/services/FooService.java
@@ -0,0 +1,39 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.bad.services;
+
+import java.util.Properties;
+
+public interface FooService {
+
+	boolean foo();
+	
+	Properties fooProps();
+	
+	Boolean getObject();
+	
+	boolean getBoolean();
+	
+	int getInt();
+	
+	long getLong();
+	
+	double getDouble();
+	
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/resources/metadata.xml b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/resources/metadata.xml
new file mode 100644
index 0000000..ca770fc
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/main/resources/metadata.xml
@@ -0,0 +1,52 @@
+<ipojo>
+	<!-- No XSD as this file violates the format -->
+	<component
+		className="org.apache.felix.ipojo.runtime.bad.components.CallbackCheckService"
+		name="BAD-CallbackCheckService" architecture="true">
+		<requires field="fs" />
+		<provides />
+		<callback transition="validate" method="start" />
+		<callback transition="invalidate" method="stop" />
+	</component>
+	
+	<component
+		classname="org.apache.felix.ipojo.runtime.bad.components.LifecycleControllerTest"
+		name="BAD-lcTest">
+		<provides />
+		<controller field="m_state" />
+		<properties>
+			<property name="conf" field="m_conf" method="setConf" />
+		</properties>
+	</component>
+	
+	<component
+		className="org.apache.felix.ipojo.runtime.bad.components.CheckServiceProvider"
+		name="BAD-BothCheckServiceProvider" architecture="true">
+		<requires field="fs">
+			<callback type="bind" method="bothBind" />
+			<callback type="unbind" method="bothUnbind" />
+		</requires>
+		<provides />
+	</component>
+	
+	<!-- Bad constructors -->
+	<component 
+		className="org.apache.felix.ipojo.runtime.bad.components.BadConstructors"
+		name="BAD-BadConstructor"
+		immediate="true"
+	/>
+	
+	<component
+		className="org.apache.felix.ipojo.runtime.bad.components.BadConstructors"
+		factory-method="createBad"
+		name="BAD-BadFactory"
+		immediate="true"
+	/>
+	
+	<component
+		className="org.apache.felix.ipojo.runtime.bad.components.BadConstructors"
+		factory-method="createBad2"
+		name="BAD-BadFactory2"
+		immediate="true"
+	/>
+</ipojo>
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/bad/test/Common.java b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/bad/test/Common.java
new file mode 100644
index 0000000..63eec74
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/bad/test/Common.java
@@ -0,0 +1,146 @@
+package org.apache.felix.ipojo.runtime.bad.test;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.TrueFileFilter;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.options.CompositeOption;
+import org.ops4j.pax.exam.options.DefaultCompositeOption;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+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.ow2.chameleon.testing.helpers.IPOJOHelper;
+import org.ow2.chameleon.testing.helpers.OSGiHelper;
+import org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import static org.ops4j.pax.exam.CoreOptions.*;
+
+/**
+ * Bootstrap the test from this project
+ */
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class Common {
+
+    @Inject
+    BundleContext bc;
+
+    OSGiHelper osgiHelper;
+    IPOJOHelper ipojoHelper;
+
+    Bundle testedBundle;
+
+    @Configuration
+    public Option[] config() throws MalformedURLException {
+        Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+        root.setLevel(Level.INFO);
+
+        return options(
+                ipojoBundles(),
+                junitBundles(),
+                testedBundle(),
+                systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("WARN")
+        );
+    }
+
+    @Before
+    public void commonSetUp() {
+        osgiHelper = new OSGiHelper(bc);
+        ipojoHelper = new IPOJOHelper(bc);
+
+        testedBundle = osgiHelper.getBundle("test.bundle");
+
+        // Dump OSGi Framework information
+        String vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VENDOR);
+        if (vendor == null) {
+            vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_SYMBOLICNAME);
+        }
+        String version = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VERSION);
+        System.out.println("OSGi Framework : " + vendor + " - " + version);
+    }
+
+    @After
+    public void commonTearDown() {
+        ipojoHelper.dispose();
+        osgiHelper.dispose();
+    }
+
+    public CompositeOption ipojoBundles() {
+        return new DefaultCompositeOption(
+                mavenBundle("org.apache.felix", "org.apache.felix.ipojo").versionAsInProject(),
+                mavenBundle("org.ow2.chameleon.testing", "osgi-helpers").versionAsInProject());
+    }
+
+    public Option testedBundle() throws MalformedURLException {
+        File out = new File("target/tested/bundle.jar");
+
+        TinyBundle tested = TinyBundles.bundle();
+
+        // We look inside target/classes to find the class and resources
+        File classes = new File("target/classes");
+        Collection<File> files = FileUtils.listFilesAndDirs(classes, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
+        List<File> services = new ArrayList<File>();
+        for (File file : files) {
+            if (file.isDirectory()) {
+                // By convention we export of .services and .service package
+                if (file.getName().endsWith("services") || file.getName().endsWith("service")) {
+                    services.add(file);
+                }
+            } else {
+                // We need to compute the path
+                String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() + 1);
+                tested.add(path, file.toURI().toURL());
+                System.out.println(file.getName() + " added to " + path);
+            }
+        }
+
+        String export = "";
+        for (File file : services) {
+            if (export.length() > 0) {
+                export += ", ";
+            }
+            String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() + 1);
+            String packageName = path.replace('/', '.');
+            export += packageName;
+        }
+
+        System.out.println("Exported packages : " + export);
+
+        InputStream inputStream = tested
+                .set(Constants.BUNDLE_SYMBOLICNAME, "test.bundle")
+                .set(Constants.IMPORT_PACKAGE, "*")
+                .set(Constants.EXPORT_PACKAGE, export)
+                .build(IPOJOStrategy.withiPOJO(new File("src/main/resources")));
+
+        try {
+            FileUtils.copyInputStreamToFile(inputStream, out);
+            return bundle(out.toURI().toURL().toExternalForm());
+        } catch (MalformedURLException e) {
+            throw new RuntimeException("Cannot compute the url of the manipulated bundle");
+        } catch (IOException e) {
+            throw new RuntimeException("Cannot write of the manipulated bundle");
+        }
+    }
+
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/bad/test/TestBadFactories.java b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/bad/test/TestBadFactories.java
new file mode 100644
index 0000000..fb88fa9
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/bad/test/TestBadFactories.java
@@ -0,0 +1,140 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.bad.test;
+
+import org.apache.felix.ipojo.*;
+import org.apache.felix.ipojo.metadata.Attribute;
+import org.apache.felix.ipojo.metadata.Element;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
+
+public class TestBadFactories extends Common {
+
+    private Element getElementFactoryWithNoClassName() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("name", "noclassname"));
+        return elem;
+    }
+
+    private Element getElementHandlerFactoryWithNoClassName() {
+        Element elem = new Element("handler", "");
+        elem.addAttribute(new Attribute("name", "noclassname"));
+        return elem;
+    }
+
+    private Element getElementHandlerFactoryWithNoName() {
+        Element elem = new Element("handler", "");
+        elem.addAttribute(new Attribute("className", "noclassname"));
+        return elem;
+    }
+
+    @Test
+    public void testBadFactory() {
+        try {
+            new ComponentFactory(osgiHelper.getContext(), getElementFactoryWithNoClassName());
+            fail("A factory with no class name must be rejected");
+        } catch (ConfigurationException e) {
+            // OK.
+        }
+    }
+
+    @Test
+    public void testBadHandlerFactory1() {
+        try {
+            new HandlerManagerFactory(osgiHelper.getContext(), getElementHandlerFactoryWithNoClassName());
+            fail("An handler factory with no class name must be rejected");
+        } catch (ConfigurationException e) {
+            // OK.
+        }
+    }
+
+    @Test
+    public void testBadHandlerFactory2() {
+        try {
+            new HandlerManagerFactory(osgiHelper.getContext(), getElementHandlerFactoryWithNoName());
+            fail("An handler factory with no name must be rejected");
+        } catch (ConfigurationException e) {
+            // OK.
+        }
+    }
+
+    @Test
+    public void testCreationOnBadConstructor() {
+        Factory factory = ipojoHelper.getFactory("BAD-BadConstructor");
+        ComponentInstance ci;
+        try {
+            // Change in Felix-966, now throws a runtime exception
+            ci = factory.createComponentInstance(null);
+            //assertEquals("Check ci create error", ComponentInstance.STOPPED, ci.getState());
+            ci.dispose();
+            fail("Exception expected");
+        } catch (Throwable e) {
+            //fail("Exception unexpected : " + e.getMessage());
+            // OK
+        }
+    }
+
+    @Test
+    public void testCreationOnBadFactory() {
+        Factory factory = ipojoHelper.getFactory("BAD-BadFactory");
+        ComponentInstance ci;
+        try {
+            // Change in Felix-966, now throw a runtime exception
+            ci = factory.createComponentInstance(null);
+            //assertEquals("Check ci create error", ComponentInstance.STOPPED, ci.getState());
+            ci.dispose();
+            fail("Exception expected");
+        } catch (Throwable e) {
+            //fail("Exception unexpected : " + e.getMessage());
+            //OK
+        }
+    }
+
+    @Test
+    public void testCreationOnBadFactory2() {
+        Factory factory = ipojoHelper.getFactory("BAD-BadFactory2");
+        ComponentInstance ci;
+        try {
+            // Change in Felix-966, now throw a runtime exception
+            ci = factory.createComponentInstance(null);
+            //assertEquals("Check ci create error", ComponentInstance.STOPPED, ci.getState());
+            ci.dispose();
+            fail("Exception expected");
+        } catch (Throwable e) {
+            //fail("Exception unexpected : " + e.getMessage());
+            //Ok
+        }
+    }
+
+    @Test
+    public void testNoManipulationMetadata() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("classname", "org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"));
+        try {
+            ComponentFactory fact = new ComponentFactory(osgiHelper.getContext(), elem);
+            fact.stop();
+            fail("A factory with no manipulation metadata must be rejected");
+        } catch (ConfigurationException e) {
+            // OK.
+        }
+    }
+
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/bad/test/TestBadLFCCallback.java b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/bad/test/TestBadLFCCallback.java
new file mode 100644
index 0000000..edf5548
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/bad/test/TestBadLFCCallback.java
@@ -0,0 +1,261 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.bad.test;
+
+import org.apache.felix.ipojo.*;
+import org.apache.felix.ipojo.metadata.Attribute;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.parser.ManifestMetadataParser;
+import org.apache.felix.ipojo.parser.ParseException;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Properties;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+public class TestBadLFCCallback extends Common {
+
+    private String clazz = "org.apache.felix.ipojo.runtime.bad.components.CallbackCheckService";
+    private String type = "BAD-CallbackCheckService";
+    private Element manipulation;
+    private Properties props;
+
+    @Before
+    public void setUp() {
+        manipulation = getManipulationForComponent();
+        props = new Properties();
+        props.put("instance.name", "BAD");
+    }
+
+
+    private Element getNothing() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("classname", clazz));
+
+        Element callback = new Element("callback", "");
+        elem.addElement(callback);
+        elem.addElement(manipulation);
+        return elem;
+    }
+
+    private Element getNoTransition() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("classname", clazz));
+
+        Element callback = new Element("callback", "");
+        callback.addAttribute(new Attribute("method", "start"));
+        elem.addElement(callback);
+        elem.addElement(manipulation);
+        return elem;
+    }
+
+    private Element getNoMethod() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("classname", clazz));
+
+        Element callback = new Element("callback", "");
+        callback.addAttribute(new Attribute("transition", "validate"));
+        elem.addElement(callback);
+        elem.addElement(manipulation);
+        return elem;
+    }
+
+    private Element getBadMethod() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("classname", clazz));
+
+        Element callback = new Element("callback", "");
+        callback.addAttribute(new Attribute("transition", "validate"));
+        callback.addAttribute(new Attribute("method", "start_")); // Missing method.
+        elem.addElement(callback);
+        elem.addElement(manipulation);
+        return elem;
+    }
+
+    private Element getBadMethod2() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("classname", clazz));
+
+        Element callback = new Element("callback", "");
+        callback.addAttribute(new Attribute("transition", "invalidate"));
+        callback.addAttribute(new Attribute("method", "stop_")); // Missing method.
+        elem.addElement(callback);
+        elem.addElement(manipulation);
+        return elem;
+    }
+
+    private Element getBadTransition() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("classname", clazz));
+
+        Element callback = new Element("callback", "");
+        callback.addAttribute(new Attribute("method", "start"));
+        callback.addAttribute(new Attribute("transition", "validate_"));
+        elem.addElement(callback);
+        elem.addElement(manipulation);
+        return elem;
+    }
+
+    private Element getManipulationForComponent() {
+        String header = testedBundle.getHeaders().get("iPOJO-Components");
+        Element elem = null;
+        try {
+            elem = ManifestMetadataParser.parseHeaderMetadata(header);
+        } catch (ParseException e) {
+            fail("Parse Exception when parsing iPOJO-Component");
+        }
+
+        assertNotNull("Check elem not null", elem);
+
+        Element manip = getManipulationForComponent(elem, type);
+        assertNotNull("Check manipulation metadata not null for " + type, manip);
+        return manip;
+    }
+
+    private Element getManipulationForComponent(Element metadata, String comp_name) {
+        Element[] comps = metadata.getElements("component");
+        for (int i = 0; i < comps.length; i++) {
+            if (comps[i].containsAttribute("factory") && comps[i].getAttribute("factory").equals(comp_name)) {
+                return comps[i].getElements("manipulation")[0];
+            }
+            if (comps[i].containsAttribute("name") && comps[i].getAttribute("name").equals(comp_name)) {
+                return comps[i].getElements("manipulation")[0];
+            }
+        }
+        return null;
+    }
+
+    @Test
+    public void testNothing() {
+        try {
+            ComponentFactory cf = new ComponentFactory(osgiHelper.getContext(), getNothing());
+            cf.start();
+            ComponentInstance ci = cf.createComponentInstance(props);
+            ci.dispose();
+            cf.stop();
+            fail("A lifecycle callback with a missing method and transition must be rejected " + cf);
+        } catch (ConfigurationException e) {
+            // OK
+        } catch (UnacceptableConfiguration e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        } catch (MissingHandlerException e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        }
+    }
+
+    @Test
+    public void testNoTransition() {
+        try {
+            ComponentFactory cf = new ComponentFactory(osgiHelper.getContext(), getNoTransition());
+            cf.start();
+            ComponentInstance ci = cf.createComponentInstance(props);
+            ci.dispose();
+            cf.stop();
+            fail("A lifecycle callback with a missing transition must be rejected " + cf);
+        } catch (ConfigurationException e) {
+            // OK
+        } catch (UnacceptableConfiguration e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        } catch (MissingHandlerException e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        }
+    }
+
+    @Test
+    public void testNoMethod() {
+        try {
+            ComponentFactory cf = new ComponentFactory(osgiHelper.getContext(), getNoMethod());
+            cf.start();
+            ComponentInstance ci = cf.createComponentInstance(props);
+            ci.dispose();
+            cf.stop();
+            fail("A lifecycle callback with a missing method must be rejected " + cf);
+        } catch (ConfigurationException e) {
+            // OK
+        } catch (UnacceptableConfiguration e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        } catch (MissingHandlerException e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        }
+    }
+
+    @Test
+    public void testBadMethod() {
+        try {
+            ComponentFactory cf = new ComponentFactory(testedBundle.getBundleContext(), getBadMethod());
+            cf.start();
+            ComponentInstance ci = cf.createComponentInstance(props);
+            if (ci.isStarted()) {
+                fail("A lifecycle callback with a bad method must be rejected (instance stills valid)" + cf);
+            }
+            ci.dispose();
+            cf.stop();
+        } catch (ConfigurationException e) {
+            //The check does not happen in the configure method.
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        } catch (UnacceptableConfiguration e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        } catch (MissingHandlerException e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        }
+    }
+
+    @Test
+    public void testBadMethod2() {
+        try {
+            ComponentFactory cf = new ComponentFactory(testedBundle.getBundleContext(), getBadMethod2());
+            cf.start();
+            ComponentInstance ci = cf.createComponentInstance(props);
+            ci.stop();
+            if (ci.isStarted()) {
+                fail("A lifecycle callback with a bad method must be rejected (instance stills valid)" + cf);
+            }
+            ci.dispose();
+            cf.stop();
+        } catch (ConfigurationException e) {
+            //The check does not happen in the configure method.
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        } catch (UnacceptableConfiguration e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        } catch (MissingHandlerException e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        }
+    }
+
+    @Test
+    public void testBadTransition() {
+        try {
+            ComponentFactory cf = new ComponentFactory(osgiHelper.getContext(), getBadTransition());
+            cf.start();
+            ComponentInstance ci = cf.createComponentInstance(props);
+            ci.dispose();
+            cf.stop();
+            fail("A lifecycle callback with a bad transition must be rejected " + cf);
+        } catch (ConfigurationException e) {
+            // OK
+        } catch (UnacceptableConfiguration e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        } catch (MissingHandlerException e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        }
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/bad/test/TestBadLFCController.java b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/bad/test/TestBadLFCController.java
new file mode 100644
index 0000000..8206d2b
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/bad/test/TestBadLFCController.java
@@ -0,0 +1,105 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.bad.test;
+
+import org.apache.felix.ipojo.ComponentFactory;
+import org.apache.felix.ipojo.metadata.Attribute;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.parser.ManifestMetadataParser;
+import org.apache.felix.ipojo.parser.ParseException;
+import org.junit.Test;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+public class TestBadLFCController extends Common {
+
+    private String clazz = "org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest";
+
+    private Element getNoFieldController() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("classname", clazz));
+
+        Element controller = new Element("controller", "");
+        elem.addElement(controller);
+        return elem;
+    }
+
+    private Element getBadFieldController() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("classname", clazz));
+
+        Element controller = new Element("controller", "");
+        controller.addAttribute(new Attribute("field", "controller")); // Missing field
+        elem.addElement(controller);
+        elem.addElement(getManipulationForComponent("BAD-lcTest"));
+        return elem;
+    }
+
+    private Element getManipulationForComponent(String comp_name) {
+        String header = testedBundle.getHeaders().get("iPOJO-Components");
+        Element elem = null;
+        try {
+            elem = ManifestMetadataParser.parseHeaderMetadata(header);
+        } catch (ParseException e) {
+            fail("Parse Exception when parsing iPOJO-Component");
+        }
+
+        assertNotNull("Check elem not null", elem);
+
+        Element manip = getManipulationForComponent(elem, comp_name);
+        assertNotNull("Check manipulation metadata not null for " + comp_name, manip);
+        return manip;
+    }
+
+    private Element getManipulationForComponent(Element metadata, String comp_name) {
+        Element[] comps = metadata.getElements("component");
+        for (Element comp : comps) {
+            if (comp.containsAttribute("name") && comp.getAttribute("name").equals(comp_name)) {
+                return comp.getElements("manipulation")[0];
+            }
+        }
+        return null;
+    }
+
+    @Test
+    public void testNoField() {
+        try {
+            ComponentFactory cf = new ComponentFactory(osgiHelper.getContext(), getNoFieldController());
+            cf.start();
+            cf.stop();
+            fail("A lifecycle controller with a missing field must be rejected " + cf);
+        } catch (Exception e) {
+            // OK
+        }
+    }
+
+    @Test
+    public void testBadField() {
+        try {
+            ComponentFactory cf = new ComponentFactory(osgiHelper.getContext(), getBadFieldController());
+            cf.start();
+            cf.stop();
+            fail("A lifecycle controller with a bad field must be rejected " + cf);
+        } catch (Exception e) {
+            // OK
+        }
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/bad/test/TestBadServiceDependencies.java b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/bad/test/TestBadServiceDependencies.java
new file mode 100644
index 0000000..85a70c3
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/bad/test/TestBadServiceDependencies.java
@@ -0,0 +1,254 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.bad.test;
+
+import org.apache.felix.ipojo.*;
+import org.apache.felix.ipojo.metadata.Attribute;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.parser.ManifestMetadataParser;
+import org.apache.felix.ipojo.parser.ParseException;
+import org.apache.felix.ipojo.runtime.bad.services.BarService;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Properties;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+public class TestBadServiceDependencies extends Common {
+
+    private String clazz = "org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider";
+    private String type = "BAD-BothCheckServiceProvider";
+    private Element manipulation;
+    private Properties props;
+
+    @Before
+    public void setUp() {
+        manipulation = getManipulationForComponent();
+        props = new Properties();
+        props.put("instance.name", "BAD");
+    }
+
+
+    private Element getNothing() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("classname", clazz));
+
+        Element callback = new Element("requires", "");
+        elem.addElement(callback);
+        elem.addElement(manipulation);
+        return elem;
+    }
+
+    private Element getNoField() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("classname", clazz));
+
+        Element callback = new Element("requires", "");
+        callback.addAttribute(new Attribute("filter", "(foo=bar)"));
+        elem.addElement(callback);
+        elem.addElement(manipulation);
+        return elem;
+    }
+
+    private Element getBadField() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("classname", clazz));
+
+        Element callback = new Element("requires", "");
+        callback.addAttribute(new Attribute("field", "BAD_FIELD")); // missing field.
+        elem.addElement(callback);
+        elem.addElement(manipulation);
+        return elem;
+    }
+
+    private Element getBadFilter() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("classname", clazz));
+
+        Element callback = new Element("requires", "");
+        callback.addAttribute(new Attribute("field", "fs"));
+        callback.addAttribute(new Attribute("filter", "(foo=bar)&(bar=foo)")); // Incorrect filter
+        elem.addElement(callback);
+        elem.addElement(manipulation);
+        return elem;
+    }
+
+    private Element getBadFrom() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("classname", clazz));
+
+        Element callback = new Element("requires", "");
+        callback.addAttribute(new Attribute("field", "fs"));
+        callback.addAttribute(new Attribute("from", "ba(d&_")); // Incorrect from
+        elem.addElement(callback);
+        elem.addElement(manipulation);
+        return elem;
+    }
+
+    private Element getBadType() {
+        Element elem = new Element("component", "");
+        elem.addAttribute(new Attribute("classname", clazz));
+
+        Element callback = new Element("requires", "");
+        callback.addAttribute(new Attribute("field", "fs"));
+        callback.addAttribute(new Attribute("interface", BarService.class.getName()));
+        elem.addElement(callback);
+        elem.addElement(manipulation);
+        return elem;
+    }
+
+    private Element getManipulationForComponent() {
+        String header = testedBundle.getHeaders().get("iPOJO-Components");
+        Element elem = null;
+        try {
+            elem = ManifestMetadataParser.parse(header);
+        } catch (ParseException e) {
+            fail("Parse Exception when parsing iPOJO-Component");
+        }
+
+        assertNotNull("Check elem not null", elem);
+
+        Element manip = getManipulationForComponent(elem, type);
+        assertNotNull("Check manipulation metadata not null for " + type, manip);
+        return manip;
+    }
+
+    private Element getManipulationForComponent(Element metadata, String comp_name) {
+        Element[] comps = metadata.getElements("component");
+        for (Element comp : comps) {
+            if (comp.containsAttribute("factory") && comp.getAttribute("factory").equals(comp_name)) {
+                return comp.getElements("manipulation")[0];
+            }
+            if (comp.containsAttribute("name") && comp.getAttribute("name").equals(comp_name)) {
+                return comp.getElements("manipulation")[0];
+            }
+        }
+        return null;
+    }
+
+    @Test
+    public void testNothing() {
+        try {
+            ComponentFactory cf = new ComponentFactory(osgiHelper.getContext(), getNothing());
+            cf.start();
+            ComponentInstance ci = cf.createComponentInstance(props);
+            ci.dispose();
+            cf.stop();
+            fail("A service requirement with neither field and method must be rejected " + cf);
+        } catch (ConfigurationException e) {
+            // OK
+        } catch (UnacceptableConfiguration e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        } catch (MissingHandlerException e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        }
+    }
+
+    @Test
+    public void testNoField() {
+        try {
+            ComponentFactory cf = new ComponentFactory(osgiHelper.getContext(), getNoField());
+            cf.start();
+            ComponentInstance ci = cf.createComponentInstance(props);
+            ci.dispose();
+            cf.stop();
+            fail("A service requirement with neither field and method must be rejected " + cf);
+        } catch (ConfigurationException e) {
+            // OK
+        } catch (UnacceptableConfiguration e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        } catch (MissingHandlerException e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        }
+    }
+
+    @Test
+    public void testBadField() {
+        try {
+            ComponentFactory cf = new ComponentFactory(osgiHelper.getContext(), getBadField());
+            cf.start();
+            ComponentInstance ci = cf.createComponentInstance(props);
+            ci.dispose();
+            cf.stop();
+            fail("A service requirement with a bad field must be rejected " + cf);
+        } catch (ConfigurationException e) {
+            // OK
+        } catch (UnacceptableConfiguration e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        } catch (MissingHandlerException e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        }
+    }
+
+    @Test
+    public void testBadFilter() {
+        try {
+            ComponentFactory cf = new ComponentFactory(osgiHelper.getContext(), getBadFilter());
+            cf.start();
+            ComponentInstance ci = cf.createComponentInstance(props);
+            ci.dispose();
+            cf.stop();
+            fail("A service requirement with a bad filter must be rejected " + cf);
+        } catch (ConfigurationException e) {
+            //OK
+        } catch (UnacceptableConfiguration e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        } catch (MissingHandlerException e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        }
+    }
+
+    @Test
+    public void testBadFrom() {
+        try {
+            ComponentFactory cf = new ComponentFactory(osgiHelper.getContext(), getBadFrom());
+            cf.start();
+            ComponentInstance ci = cf.createComponentInstance(props);
+            ci.dispose();
+            cf.stop();
+            fail("A service requirement with a bad from must be rejected " + cf);
+        } catch (ConfigurationException e) {
+            //OK
+        } catch (UnacceptableConfiguration e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        } catch (MissingHandlerException e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        }
+    }
+
+    @Test
+    public void testBadType() {
+        try {
+            ComponentFactory cf = new ComponentFactory(osgiHelper.getContext(), getBadType());
+            cf.start();
+            ComponentInstance ci = cf.createComponentInstance(props);
+            ci.dispose();
+            cf.stop();
+            fail("A service requirement with a bad type must be rejected " + cf);
+        } catch (ConfigurationException e) {
+            // OK
+        } catch (UnacceptableConfiguration e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        } catch (MissingHandlerException e) {
+            fail("Unexpected exception when creating an instance : " + e.getMessage());
+        }
+    }
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/resources/exam.properties b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/resources/exam.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-bad-configuration-test/src/test/resources/exam.properties
