From 09ae925ee2513555cf45da2b76372425a77aebe0 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 18 Jan 2010 18:27:30 +0000 Subject: [PATCH] proceed in case of resolution failure for a single resource entry in the list git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2831 50f2f4bb-b051-0410-bef5-90022cba6387 --- .../core/io/support/ResourceArrayPropertyEditor.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/org.springframework.core/src/main/java/org/springframework/core/io/support/ResourceArrayPropertyEditor.java b/org.springframework.core/src/main/java/org/springframework/core/io/support/ResourceArrayPropertyEditor.java index a087d4a5f9e..8e7ca5782fd 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/io/support/ResourceArrayPropertyEditor.java +++ b/org.springframework.core/src/main/java/org/springframework/core/io/support/ResourceArrayPropertyEditor.java @@ -23,6 +23,9 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.springframework.core.io.Resource; import org.springframework.util.SystemPropertyUtils; @@ -50,6 +53,8 @@ import org.springframework.util.SystemPropertyUtils; */ public class ResourceArrayPropertyEditor extends PropertyEditorSupport { + private static final Log logger = LogFactory.getLog(ResourceArrayPropertyEditor.class); + private final ResourcePatternResolver resourcePatternResolver; private final boolean ignoreUnresolvablePlaceholders; @@ -122,8 +127,10 @@ public class ResourceArrayPropertyEditor extends PropertyEditorSupport { } } catch (IOException ex) { - throw new IllegalArgumentException( - "Could not resolve resource location pattern [" + pattern + "]: " + ex.getMessage()); + // ignore - might be an unresolved placeholder or non-existing base directory + if (logger.isDebugEnabled()) { + logger.debug("Could not retrieve resources for pattern '" + pattern + "': " + ex); + } } } else if (element instanceof Resource) {