From: pero Date: Mon, 3 May 2010 09:44:39 +0000 (+0000) Subject: Search to more jars and fix testcase! X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b06f5eb3ad5d798cdf5e97e41e774d2f6e59aedb;p=tomcat7.0 Search to more jars and fix testcase! git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@940405 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/naming/resources/BaseDirContext.java b/java/org/apache/naming/resources/BaseDirContext.java index 1c48fe528..b388050e3 100644 --- a/java/org/apache/naming/resources/BaseDirContext.java +++ b/java/org/apache/naming/resources/BaseDirContext.java @@ -456,9 +456,13 @@ public abstract class BaseDirContext implements DirContext { // Check the alternate locations for (DirContext altDirContext : altDirContexts) { - obj = altDirContext.lookup("META-INF/resources/" + name); - if (obj != null) - return obj; + try { + obj = altDirContext.lookup("META-INF/resources/" + name); + if (obj != null) + return obj; + } catch ( NamingException ex) { + // ignore + } } // Really not found diff --git a/test/org/apache/catalina/core/TestStandardContextResources.java b/test/org/apache/catalina/core/TestStandardContextResources.java index 92206d072..6a1fde1c3 100644 --- a/test/org/apache/catalina/core/TestStandardContextResources.java +++ b/test/org/apache/catalina/core/TestStandardContextResources.java @@ -84,7 +84,7 @@ public class TestStandardContextResources extends TomcatBaseTest { tomcat.start(); assertPageContains("/test/getresource?path=/resourceF.jsp", - "

resourceF.jsp in the web application

"); + "

resourceF.jsp in resources2.jar

"); assertPageContains("/test/getresource?path=/resourceA.jsp", "

resourceA.jsp in the web application

"); assertPageContains("/test/getresource?path=/resourceB.jsp", diff --git a/test/webapp-3.0-fragments/WEB-INF/lib/resources2.jar b/test/webapp-3.0-fragments/WEB-INF/lib/resources2.jar index 66155767d..62a41a913 100644 Binary files a/test/webapp-3.0-fragments/WEB-INF/lib/resources2.jar and b/test/webapp-3.0-fragments/WEB-INF/lib/resources2.jar differ