FELIX-3400 applied the patch with some small changes to keep it 1.3 compatible

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1304235 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AutoConfResourceProcessor.java b/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AutoConfResourceProcessor.java
index fc7a06b..6905e3c 100644
--- a/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AutoConfResourceProcessor.java
+++ b/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AutoConfResourceProcessor.java
@@ -152,9 +152,25 @@
         Iterator i = designates.keySet().iterator();
         while (i.hasNext()) {
             Designate designate = (Designate) designates.get(i.next());
+            
+            // check object
+            if (designate.getObject() == null) {
+                throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Designate Object child missing or invalid");
+            }
+            
+            // check attributes
+            if (designate.getObject().getAttributes() == null || designate.getObject().getAttributes().size() == 0) {
+                throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Object Attributes child missing or invalid");
+            }
+            
+            // check ocdRef
+            String ocdRef = designate.getObject().getOcdRef();
+            if (ocdRef == null || "".equals(ocdRef)) {
+                throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Object ocdRef attribute missing or invalid");
+            }
+
             // determine OCD
             ObjectClassDefinition ocd = null;
-            String ocdRef = designate.getObject().getOcdRef();
             OCD localOcd = (OCD) localOcds.get(ocdRef);
             // ask meta type service for matching OCD if no local OCD has been defined
             ocd = (localOcd != null) ? new ObjectClassDefinitionImpl(localOcd) : getMetaTypeOCD(data, designate);