bug 404006: Use the hashcode of the resource URL as a key in the Map that holds the resources URLs.
diff --git a/org.eclipse.gemini.web.test/src/test/java/org/eclipse/gemini/web/test/tomcat/TomcatServletContainerTests.java b/org.eclipse.gemini.web.test/src/test/java/org/eclipse/gemini/web/test/tomcat/TomcatServletContainerTests.java
index 020c7e7..7b4f273 100644
--- a/org.eclipse.gemini.web.test/src/test/java/org/eclipse/gemini/web/test/tomcat/TomcatServletContainerTests.java
+++ b/org.eclipse.gemini.web.test/src/test/java/org/eclipse/gemini/web/test/tomcat/TomcatServletContainerTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009, 2012 VMware Inc.
+ * Copyright (c) 2009, 2013 VMware Inc.
  *
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -159,6 +159,7 @@
             validateURLExpectedContent("http://localhost:8080/war-with-servlet/", new String[] { "path info: /", "servlet path: ", "context path: " });
             validateURLExpectedContent("http://localhost:8080/war-with-servlet/alabala", new String[] { "path info: null", "servlet path: /alabala",
                 "context path: /war-with-servlet" });
+            validateURLExpectedContent("http://localhost:8080/war-with-servlet/test.jsp", new String[] { "Found resources 2" });
         } finally {
             this.container.stopWebApplication(handle);
         }
@@ -203,7 +204,8 @@
 
     @Test
     public void testWarWithJSTLFromDependency() throws MalformedURLException, IOException, BundleException {
-        String jstlLocation = "file:" + IVY_CACHE + "/repository/org.eclipse.virgo.mirrored/javax.servlet.jsp.jstl/1.2.0.v201105211821/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar";
+        String jstlLocation = "file:" + IVY_CACHE
+            + "/repository/org.eclipse.virgo.mirrored/javax.servlet.jsp.jstl/1.2.0.v201105211821/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar";
         Bundle jstlBundle = this.bundleContext.installBundle(jstlLocation);
 
         try {
@@ -232,7 +234,8 @@
 
     @Test
     public void testWarWithJSTLFromExplodedDependency() throws MalformedURLException, IOException, BundleException {
-        String jstlPath = IVY_CACHE + "/repository/org.eclipse.virgo.mirrored/javax.servlet.jsp.jstl/1.2.0.v201105211821/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar";
+        String jstlPath = IVY_CACHE
+            + "/repository/org.eclipse.virgo.mirrored/javax.servlet.jsp.jstl/1.2.0.v201105211821/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar";
         PathReference jstl = new PathReference(jstlPath);
         PathReference unzippedJstl = explode(jstl);
 
diff --git a/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/loading/ChainedClassLoader.java b/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/loading/ChainedClassLoader.java
index 199e061..bcfdbee 100644
--- a/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/loading/ChainedClassLoader.java
+++ b/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/loading/ChainedClassLoader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009, 2010 VMware Inc.
+ * Copyright (c) 2009, 2013 VMware Inc.
  *
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -118,13 +118,13 @@
     }
 
     private Enumeration<URL> doGetResources(String name) throws IOException {
-        Map<String, URL> urls = new HashMap<String, URL>();
+        Map<Integer, URL> urls = new HashMap<Integer, URL>();
         for (ClassLoader loader : this.loaders) {
             Enumeration<URL> resources = loader.getResources(name);
             if (resources != null) {
                 while (resources.hasMoreElements()) {
                     URL url = resources.nextElement();
-                    urls.put(url.getFile(), url);
+                    urls.put(url.hashCode(), url);
                 }
             }
         }
diff --git a/test-bundles/war-with-servlet/src/main/webapp/WEB-INF/lib/resource.jar b/test-bundles/war-with-servlet/src/main/webapp/WEB-INF/lib/resource.jar
index da34155..402c5bb 100755
--- a/test-bundles/war-with-servlet/src/main/webapp/WEB-INF/lib/resource.jar
+++ b/test-bundles/war-with-servlet/src/main/webapp/WEB-INF/lib/resource.jar
Binary files differ
diff --git a/test-bundles/war-with-servlet/src/main/webapp/WEB-INF/lib/resource1.jar b/test-bundles/war-with-servlet/src/main/webapp/WEB-INF/lib/resource1.jar
new file mode 100644
index 0000000..8c0e61e
--- /dev/null
+++ b/test-bundles/war-with-servlet/src/main/webapp/WEB-INF/lib/resource1.jar
Binary files differ
diff --git a/test-bundles/war-with-servlet/src/main/webapp/test.jsp b/test-bundles/war-with-servlet/src/main/webapp/test.jsp
new file mode 100644
index 0000000..2f054e2
--- /dev/null
+++ b/test-bundles/war-with-servlet/src/main/webapp/test.jsp
@@ -0,0 +1,20 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+    pageEncoding="ISO-8859-1" import="java.util.*, java.net.*"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Insert title here</title>
+</head>
+<body>
+<%
+  int i = 0;
+  Enumeration<URL> e = this.getClass().getClassLoader().getResources("test.txt");
+  while (e.hasMoreElements()) {
+    out.println(e.nextElement());
+    i++;
+  }
+  out.println("Found resources " + i);
+%>
+</body>
+</html>
\ No newline at end of file