cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r823970 - /cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
Date Sat, 10 Oct 2009 22:32:35 GMT
Author: cschneider
Date: Sat Oct 10 22:32:35 2009
New Revision: 823970

URL: http://svn.apache.org/viewvc?rev=823970&view=rev
Log:
CXF-806 Show better error messages when java2ws fails

Modified:
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java?rev=823970&r1=823969&r2=823970&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
(original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
Sat Oct 10 22:32:35 2009
@@ -83,10 +83,18 @@
             }
             throw ex;
         } catch (Exception ex) {
-            err.println("Error: " + ex.getMessage());
+            
+            // Try to find an exception with a message on the stack
+            Throwable e = ex.getCause();
+            while ((e.getMessage() == null || "".equals(e.getMessage())) && e.getCause()
!= null) {
+                e = e.getCause();
+            }
+            err.println("Error: " + e.toString());
             err.println();
             if (isVerboseOn()) {
                 ex.printStackTrace(err);
+            } else {
+                err.println("Use the verbose setting to show the stacktrace of this error");
             }
 
             throw new ToolException(ex.getMessage(), ex.getCause());



Mime
View raw message