diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveInstanceDescription.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveInstanceDescription.java
index f09686e..e066251 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveInstanceDescription.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveInstanceDescription.java
@@ -1,4 +1,4 @@
-/* 
+/*
  * 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
@@ -34,11 +34,11 @@
 
 /**
  * Primitive Instance Description.
- * 
+ *
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class PrimitiveInstanceDescription extends InstanceDescription {
-    
+
     /**
      * Creates a Primitive Instance Description.
      * @param type the component type description
@@ -64,7 +64,7 @@
             return new String[0];
         }
     }
-    
+
     /**
      * Gets the instance service dependencies.
      * @return the set of dependency description or an empty array if
@@ -79,7 +79,7 @@
                     .getDescription()).getDependencies();
         }
     }
-    
+
     /**
      * Gets the instance service dependency matching with the given service specification or id.
      * @param specification the service specification of the looked specification.
@@ -97,12 +97,12 @@
                         || specification.equals(deps[i].getSpecification())) {
                     return deps[i];
                 }
-                        
+
             }
         }
         return null;
     }
-    
+
     /**
      * Gets the instance provided service matching with the given service specification.
      * @param specification the provided specification of the looked provided service.
@@ -120,12 +120,12 @@
                     if (specification.equals(str[j])) {
                         return pss[i];
                     }
-                }        
+                }
             }
         }
         return null;
     }
-    
+
     /**
      * Gets the instance provided service.
      * @return the set of provided service description or an empty array if
@@ -140,7 +140,7 @@
                     .getDescription()).getProvidedServices();
         }
     }
-    
+
     /**
      * Gets the instance properties.
      * @return the set of property descriptions or an empty array if
@@ -155,7 +155,7 @@
                     .getDescription()).getProperties();
         }
     }
-    
+
     /**
      * Gets the instance description.
      * Overridden to add created objects.
@@ -165,14 +165,14 @@
         Element elem = super.getDescription();
         // Created Object (empty is composite)
         String[] objs = getCreatedObjects();
-        for (int i = 0; i < objs.length; i++) {
+        for (int i = 0; objs != null  && i < objs.length; i++) {
             Element obj = new Element("Object", "");
             obj.addAttribute(new Attribute("name", ((Object) objs[i]).toString()));
             elem.addElement(obj);
         }
         return elem;
     }
-    
-    
+
+
 
 }
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
index 0c82646..e7cf61d 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
@@ -300,7 +300,8 @@
         cr.accept(collector, 0);
 
         if (collector.isIgnoredBecauseOfMissingComponent()) {
-            warn("Annotation processing ignored in " + collector.getClassName() + " - @Component missing");
+        	// No @Component, just skip.
+            //warn("Annotation processing ignored in " + collector.getClassName() + " - @Component missing");
         } else if (collector.isComponentType()) {
             boolean toskip = false;
             for (int i = 0; !toskip && i < m_metadata.size(); i++) {
@@ -329,7 +330,7 @@
 
                 // Instantiate ?
                 if (collector.getInstanceDeclaration() != null) {
-                    warn("Declaring an empty instance of " + elem.getAttribute("classname"));
+                    //warn("Declaring an empty instance of " + elem.getAttribute("classname"));
                     m_metadata.add(collector.getInstanceDeclaration());
                 }
             }
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoAnnotation.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoAnnotation.java
new file mode 100644
index 0000000..8e24846
--- /dev/null
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoAnnotation.java
@@ -0,0 +1,5 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+public class NoAnnotation {
+
+}
