[jboss-svn-commits] JBL Code SVN: r38243 - labs/jbossesb/branches/JBESB_4_11_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Nov 1 16:06:45 EDT 2012


Author: tcunning
Date: 2012-11-01 16:06:45 -0400 (Thu, 01 Nov 2012)
New Revision: 38243

Modified:
   labs/jbossesb/branches/JBESB_4_11_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/RemoteWsdlLoader.java
Log:
JBESB-3874
Improve debug messages and exception messages on resource loading in RemoteWsdlLoader.


Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/RemoteWsdlLoader.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/RemoteWsdlLoader.java	2012-11-01 19:27:38 UTC (rev 38242)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/RemoteWsdlLoader.java	2012-11-01 20:06:45 UTC (rev 38243)
@@ -22,6 +22,7 @@
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Map.Entry;
 import java.util.Properties;
@@ -71,20 +72,28 @@
         
         // file, vfs, vfsfile, vfsjar, vfsmemory, vfszip, zip
         if(url.startsWith("file") || url.startsWith("vfs") || url.startsWith("zip")) {
+            logger.debug("Loading resource " + url);
             originalStream = new URL(url).openStream();
         } else if(url.startsWith(JBossWSFactory.ESB_INTERNAL_URI)) {
+	    logger.debug("Loading resource " + url);
             originalStream = JBossWSFactory.getFactory().getWsdl(url) ;
         } else if(url.startsWith("classpath://")) {
+		logger.debug("Loading resource " + url.substring(12, url.length())
+			+ " with ClassLoader of " + getClass().getName());
         	originalStream = ClassUtil.getResource(url.substring(12, url.length()), getClass()).openStream();
         } else {
+	    logger.debug("Loading resource from " + url + ", assuming http protocol.");
             HttpMethodBase httpMethod;
             
             try {
     			HttpMethodFactory methodFactory = HttpMethodFactory.Factory.getInstance("GET", config, new URL(url));
     			httpMethod = methodFactory.getInstance(null);
     		} catch (ConfigurationException ce) {
-    			throw (IOException)(new IOException(ce.getMessage()).initCause(ce));
-    		}
+    		    throw (IOException)(new IOException(ce.getMessage()).initCause(ce));
+    		} catch (MalformedURLException mue) {
+                    throw (IOException)(new IOException("Tried to create URL from " + url + " but failed - please check "
+			+ "that it represents a valid protocol.", mue)); 
+                }
 
             // Authentication is not being overridden on the method.  It needs
             // to be present on the supplied HttpClient instance!



More information about the jboss-svn-commits mailing list