diff --git a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
index f3ed7a3..639b967 100644
--- a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
+++ b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
@@ -525,7 +525,7 @@
             final String refName = entry.getKey();
             final Object[] values = entry.getValue();
             final JavaTag tag = ( JavaTag ) values[0];
-            this.doReference( tag, refName, component, values[1].toString() );
+            this.doReference( tag, refName, component, values[1].toString(), ((Boolean)values[2]).booleanValue() );
         }
 
         // pid handling
@@ -763,7 +763,13 @@
     protected void testReference( Map<String, Object[]> references, JavaTag reference, String defaultName,
         boolean isInspectedClass ) throws SCRDescriptorException
     {
-        final String refName = this.getReferenceName( reference, defaultName );
+        String refName = this.getReferenceName( reference, defaultName );
+
+        boolean setName = refName != null;
+        if ( refName == null)
+        {
+            refName = this.getReferencedInterface(reference, isInspectedClass, null);
+        }
 
         if ( refName != null )
         {
@@ -780,41 +786,54 @@
             else
             {
                 // ensure interface
-                String type = reference.getNamedParameter( Constants.REFERENCE_INTERFACE );
-                if ( StringUtils.isEmpty( type ) )
-                {
-                    if ( reference.getField() != null )
-                    {
-                        type = reference.getField().getType();
-                    }
-                    else
-                    {
-                        throw new SCRDescriptorException( "Interface missing for reference " + refName + " in class "
-                            + reference.getJavaClassDescription().getName(), reference );
-                    }
-                }
-                else if ( isInspectedClass )
-                {
-                    // check if the value points to a class/interface
-                    // and search through the imports
-                    final JavaClassDescription serviceClass = reference.getJavaClassDescription().getReferencedClass(
-                        type );
-                    if ( serviceClass == null )
-                    {
-                        throw new SCRDescriptorException( "Interface '" + type + "' in class "
-                            + reference.getJavaClassDescription().getName()
-                            + " does not point to a valid class/interface.", reference );
-                    }
-                    type = serviceClass.getName();
-                }
+                final String type = this.getReferencedInterface(reference, isInspectedClass, refName);
                 references.put( refName, new Object[]
-                    { reference, type } );
+                    { reference, type, (setName ? Boolean.TRUE : Boolean.FALSE) } );
             }
         }
+        else
+        {
+            throw new SCRDescriptorException( "No name detectable for reference in class "
+                    + reference.getJavaClassDescription().getName(), reference );
+        }
     }
 
+    protected String getReferencedInterface(final JavaTag reference,
+                                            final boolean isInspectedClass,
+                                            final String refName) throws SCRDescriptorException
+    {
+        String type = reference.getNamedParameter( Constants.REFERENCE_INTERFACE );
+        if ( StringUtils.isEmpty( type ) )
+        {
+            if ( reference.getField() != null )
+            {
+                type = reference.getField().getType();
+            }
+            else
+            {
+                throw new SCRDescriptorException( "Interface missing for reference " + (refName == null ? "" : refName) + " in class "
+                    + reference.getJavaClassDescription().getName(), reference );
+            }
+        }
+        else if ( isInspectedClass )
+        {
+            // check if the value points to a class/interface
+            // and search through the imports
+            final JavaClassDescription serviceClass = reference.getJavaClassDescription().getReferencedClass(
+                type );
+            if ( serviceClass == null )
+            {
+                throw new SCRDescriptorException( "Interface '" + type + "' in class "
+                    + reference.getJavaClassDescription().getName()
+                    + " does not point to a valid class/interface.", reference );
+            }
+            type = serviceClass.getName();
+        }
+        return type;
+    }
 
-    protected String getReferenceName( JavaTag reference, String defaultName ) throws SCRDescriptorException
+    protected String getReferenceName( final JavaTag reference,
+            final String defaultName) throws SCRDescriptorException
     {
         String name = reference.getNamedParameter( Constants.REFERENCE_NAME );
         if ( !StringUtils.isEmpty( name ) )
@@ -836,7 +855,7 @@
                 throw new SCRDescriptorException( "Referenced field " + name
                     + " has more than one value for a reference name.", reference );
             }
-            name = values[0];
+            return values[0];
         }
 
         return defaultName;
@@ -866,15 +885,20 @@
 
 
     /**
+     * Process a reference
      * @param reference
      * @param defaultName
      * @param component
      */
-    protected void doReference( JavaTag reference, String name, Component component, String type )
+    protected void doReference( JavaTag reference, String name, Component component, String type,
+            final boolean setName)
         throws SCRDescriptorException
     {
         final Reference ref = new Reference( reference, component.getJavaClassDescription() );
-        ref.setName( name );
+        if ( setName )
+        {
+            ref.setName( name );
+        }
         ref.setInterfacename( type );
         ref.setCardinality( reference.getNamedParameter( Constants.REFERENCE_CARDINALITY ) );
         if ( ref.getCardinality() == null )
diff --git a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Reference.java b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Reference.java
index a4ef68d..72588e9 100644
--- a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Reference.java
+++ b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Reference.java
@@ -22,9 +22,7 @@
 import org.apache.felix.scrplugin.SCRDescriptorException;
 import org.apache.felix.scrplugin.helper.IssueLog;
 import org.apache.felix.scrplugin.helper.StringUtils;
-import org.apache.felix.scrplugin.tags.JavaClassDescription;
-import org.apache.felix.scrplugin.tags.JavaMethod;
-import org.apache.felix.scrplugin.tags.JavaTag;
+import org.apache.felix.scrplugin.tags.*;
 
 /**
  * <code>Reference.java</code>...
@@ -169,7 +167,9 @@
 
         // validate name
         if (StringUtils.isEmpty(this.name)) {
-            this.logError( iLog, "Reference has no name" );
+            if ( specVersion < Constants.VERSION_1_1 ) {
+                this.logError( iLog, "Reference has no name" );
+            }
         }
 
         // validate interface
