Merge branch 'master' of ssh://canderson@git.eclipse.org/gitroot/jeetools/webtools.javaee.git
diff --git a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/CatalogJ2EEXmlDtDEntityResolver.java b/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/CatalogJ2EEXmlDtDEntityResolver.java
index 42f4abd..49575c1 100644
--- a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/CatalogJ2EEXmlDtDEntityResolver.java
+++ b/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/CatalogJ2EEXmlDtDEntityResolver.java
@@ -26,10 +26,26 @@
 
 	@Override
 	public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) throws IOException, org.xml.sax.SAXException {
+		// The following flag and all its usage is to debug bugzilla 459564. Needs to be removed. 
+		boolean debug = 
+				"-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN".equals(publicId)  //$NON-NLS-1$
+				&& "http://java.sun.com/dtd/application_1_3.dtd".equals(systemId); //$NON-NLS-1$
+
 		if (uriResolver == null) {
 			uriResolver = URIResolverPlugin.createResolver();
 		}
+		
+		if (debug){
+			System.out.println("CatalogJ2EEXmlDtDEntityResolver - URI resolver for publicId and systemId: " + publicId + ", " + systemId + ": " + uriResolver); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		}
+		
 		String uri = uriResolver.resolve(null, publicId, systemId);
+		
+		
+		if (debug){
+			System.out.println("CatalogJ2EEXmlDtDEntityResolver - URI resolved by " + uriResolver + " for publicId and systemId " + publicId + ", " + systemId + ": " + uri); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		}
+		
 		if (null != uri) {
 			InputSource result = new InputSource(uri);
 			result.setPublicId(publicId);
@@ -37,6 +53,11 @@
 			result.setEncoding("UTF-8"); //$NON-NLS-1$
 			return result;
 		}
+		
+		if (debug){
+			System.out.println("CatalogJ2EEXmlDtDEntityResolver - Delegating URI resolution to parent for publicId and systemId: " + publicId + ", " + systemId); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+		
 		return super.resolveEntity(publicId, systemId);
 	}