diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/resources/BundleResourceRepository.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/resources/BundleResourceRepository.java
index e4d03c5..53b5d67 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/resources/BundleResourceRepository.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/resources/BundleResourceRepository.java
@@ -40,17 +40,19 @@
 	public synchronized void addHandler(ServiceReference ref, ResourceHandler handler) {
 		String filter = (String) ref.getProperty("filter"); // "(&(repository=a)(path=b)(name=*.xml))"
 		Filter filterObject = null;
-		try {
-			filterObject = FrameworkUtil.createFilter(filter);
-		} 
-		catch (InvalidSyntaxException e) {
-			e.printStackTrace();
-			return;
+		if (filter != null) {
+    		try {
+    			filterObject = FrameworkUtil.createFilter(filter);
+    		} 
+    		catch (InvalidSyntaxException e) {
+    			e.printStackTrace();
+    			return;
+    		}
 		}
 		Enumeration entries = m_bundle.findEntries("/", null, true);
 		while (entries.hasMoreElements()) {
 			EntryResource resource = new EntryResource(m_bundle, (URL) entries.nextElement());
-			if (filterObject.match(resource)) {
+			if (filterObject == null || filterObject.match(resource)) {
                 handler.added(resource);
 			}
 		}
@@ -59,17 +61,19 @@
 	public synchronized void removeHandler(ServiceReference ref, ResourceHandler handler) {
 		String filter = (String) ref.getProperty("filter"); // "(&(repository=a)(path=b)(name=*.xml))"
 		Filter filterObject = null;
-		try {
-			filterObject = FrameworkUtil.createFilter(filter);
-		}
-		catch (InvalidSyntaxException e) {
-			e.printStackTrace();
-			return;
+		if (filter != null) {
+    		try {
+    			filterObject = FrameworkUtil.createFilter(filter);
+    		}
+    		catch (InvalidSyntaxException e) {
+    			e.printStackTrace();
+    			return;
+    		}
 		}
 		Enumeration entries = m_bundle.findEntries("/", null, true);
         while (entries.hasMoreElements()) {
             EntryResource resource = new EntryResource(m_bundle, (URL) entries.nextElement());
-            if (filterObject.match(resource)) {
+            if (filterObject == null || filterObject.match(resource)) {
                 handler.removed(resource);
             }
         }
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java
index 779d273..92b239b 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java
@@ -29,7 +29,6 @@
 import org.apache.felix.dm.annotation.api.Destroy;
 import org.apache.felix.dm.annotation.api.Service;
 import org.apache.felix.dm.annotation.api.dependency.ServiceDependency;
-import org.apache.felix.dm.resources.Resource;
 import org.apache.felix.dm.resources.ResourceHandler;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Filter;
@@ -72,17 +71,19 @@
      */
     @ServiceDependency(removed = "remove", required=false)
     public void add(Map serviceProperties, ResourceHandler handler)
-    {
+    {        
         String filterString = (String) serviceProperties.get("filter");
-        Filter filter;
-        try
-        {
-            filter = m_context.createFilter(filterString);
-        }
-        catch (InvalidSyntaxException e)
-        {
-            Assert.fail("Could not create filter for resource handler: " + e);
-            return;
+        Filter filter = null;
+        if (filterString != null) {
+            try
+            {
+                filter = m_context.createFilter(filterString);
+            }
+            catch (InvalidSyntaxException e)
+            {
+                Assert.fail("Could not create filter for resource handler: " + e);
+                return;
+            }
         }
         synchronized (m_handlers)
         {
@@ -90,7 +91,7 @@
         }
         for (int i = 0; i < m_resources.length; i++)
         {
-            if (filter.match(m_resources[i].getProperties()))
+            if (filter == null || filter.match(m_resources[i].getProperties()))
             {
                 handler.added(m_resources[i]);
             }
@@ -115,7 +116,7 @@
     {
         for (int i = 0; i < m_resources.length; i++)
         {
-            if (filter.match(m_resources[i].getProperties()))
+            if (filter == null || filter.match(m_resources[i].getProperties()))
             {
                 handler.removed(m_resources[i]);
             }
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2348_ResourceAdapterTest.java b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2348_ResourceAdapterTest.java
index b4a0d8f..9deeb81 100644
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2348_ResourceAdapterTest.java
+++ b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2348_ResourceAdapterTest.java
@@ -120,23 +120,25 @@
         
         public void add(ServiceReference ref, ResourceHandler handler) {
             String filterString = (String) ref.getProperty("filter");
-            Filter filter;
-            try {
-                filter = m_context.createFilter(filterString);
-            }
-            catch (InvalidSyntaxException e) {
-                Assert.fail("Could not create filter for resource handler: " + e);
-                return;
+            Filter filter = null;
+            if (filterString != null) {
+                try {
+                    filter = m_context.createFilter(filterString);
+                }
+                catch (InvalidSyntaxException e) {
+                    Assert.fail("Could not create filter for resource handler: " + e);
+                    return;
+                }
             }
             synchronized (m_handlers) {
                 m_handlers.put(handler, filter);
             }
-                for (int i = 0; i < m_resources.length; i++) {
-                    if (filter.match(m_resources[i].getProperties())) {
-                        handler.added(m_resources[i]);
-                    }
+            for (int i = 0; i < m_resources.length; i++) {
+                if (filter == null || filter.match(m_resources[i].getProperties())) {
+                    handler.added(m_resources[i]);
                 }
             }
+        }
 
         public void remove(ServiceReference ref, ResourceHandler handler) {
             Filter filter;
@@ -148,7 +150,7 @@
 
         private void removeResources(ResourceHandler handler, Filter filter) {
                 for (int i = 0; i < m_resources.length; i++) {
-                    if (filter.match(m_resources[i].getProperties())) {
+                    if (filter == null || filter.match(m_resources[i].getProperties())) {
                         handler.removed(m_resources[i]);
                     }
                 }
