cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject svn commit: r796994 - in /cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/common/ common/src/main/java/org/apache/cxf/tools/common/toolspec/ common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/ corba/src/main/java/org/apache/cxf...
Date Thu, 23 Jul 2009 09:56:17 GMT
Author: asoldano
Date: Thu Jul 23 09:56:16 2009
New Revision: 796994

URL: http://svn.apache.org/viewvc?rev=796994&view=rev
Log:
[CXF-2351] Make tool containers use provided err/out streams instead of directly writing to
System.out/System.err; also making quietMode do not touch the whole VM System.out/err streams.

Modified:
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolContainer.java
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolRunner.java
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java
    cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/IDLToWSDL.java
    cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/WSDLToIDL.java
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
    cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java
    cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java
    cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java
    cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/XSDToWSDL.java

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java?rev=796994&r1=796993&r2=796994&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java
(original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java
Thu Jul 23 09:56:16 2009
@@ -88,18 +88,18 @@
 
         if (commandDocument.hasParameter("help")) {
             try {
-                System.out.println(name + " " + getUsage());
-                System.out.println();
-                System.out.println("Options: ");
-                System.out.println();
-                System.out.println(parser.getFormattedDetailedUsage());
+                out.println(name + " " + getUsage());
+                out.println();
+                out.println("Options: ");
+                out.println();
+                out.println(parser.getFormattedDetailedUsage());
                 String toolUsage = parser.getToolUsage();
                 if (toolUsage != null) {
-                    System.out.println(toolUsage);
+                    out.println(toolUsage);
                 }
             } catch (Exception ex) {
-                System.err.println("Error: Could not output detailed usage");
-                System.err.println();
+                err.println("Error: Could not output detailed usage");
+                err.println();
             }
         }
         if (commandDocument.hasParameter("version")) {
@@ -149,16 +149,16 @@
     }
 
     public void outputVersion() {
-        System.out.println(name + " - " + Version.getCompleteVersionString());
-        System.out.println();
+        out.println(name + " - " + Version.getCompleteVersionString());
+        out.println();
     }
 
     public void outputFullCommandLine() {
-        System.out.print(name);
+        out.print(name);
         for (int i = 0; i < getArgument().length; i++) {
-            System.out.print(" " + getArgument()[i]);
+            out.print(" " + getArgument()[i]);
         }
-        System.out.println();
+        out.println();
     }
     
     public String getFileBase(String wsdlUrl) {
@@ -178,12 +178,12 @@
         if (verbose) {
             outputFullCommandLine();
         }
-        System.err.println(ex.getMessage());
-        System.err.println("Usage : " + toolName + " " + ex.getUsage());
+        err.println(ex.getMessage());
+        err.println("Usage : " + toolName + " " + ex.getUsage());
         if (verbose) {
             outputVersion();
         }
-        System.err.println();
+        err.println();
     }
 
     public String getFileName(String loc) {

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java?rev=796994&r1=796993&r2=796994&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
(original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
Thu Jul 23 09:56:16 2009
@@ -46,6 +46,8 @@
 
     protected ToolSpec toolspec;
     protected ToolContext context;
+    protected PrintStream out = System.out;
+    protected PrintStream err = System.err;
     
     private String arguments[];
     private boolean isVerbose;
@@ -54,9 +56,6 @@
     private CommandLineParser parser;
     private OutputStream outOutputStream;
     private OutputStream errOutputStream;
-
-    private PrintStream stdOutputStream;
-    private PrintStream stdErrorStream;
  
     public class GenericOutputStream extends OutputStream {
         public void write(int b) throws IOException {
@@ -126,15 +125,10 @@
     }
 
     public void redirectOutput() {
-        stdOutputStream = System.out;
-        stdErrorStream = System.err;
-
         outOutputStream = new GenericOutputStream();
         errOutputStream = new GenericOutputStream();
-        System.setErr(new PrintStream(errOutputStream));
-        System.setOut(new PrintStream(outOutputStream));
     }
-
+    
     public boolean isQuietMode() {
         return isQuiet;
     }
@@ -150,11 +144,23 @@
     public OutputStream getOutOutputStream() {
         return outOutputStream;
     }
+    
+    public void setOutOutputStream(OutputStream outOutputStream) {
+        this.outOutputStream = outOutputStream;
+        this.out = (outOutputStream instanceof PrintStream)
+            ? (PrintStream)outOutputStream : new PrintStream(outOutputStream);
+    }
 
     public OutputStream getErrOutputStream() {
         return errOutputStream;
     }
     
+    public void setErrOutputStream(OutputStream errOutputStream) {
+        this.errOutputStream = errOutputStream;
+        this.err = (errOutputStream instanceof PrintStream)
+            ? (PrintStream)errOutputStream : new PrintStream(errOutputStream);
+    }
+    
     public void setContext(ToolContext c) {
         context = c;
     }
@@ -176,10 +182,7 @@
     }
 
     public void tearDown() {
-        if (isQuietMode()) {
-            System.setOut(stdOutputStream);
-            System.setErr(stdErrorStream);
-        }
+        //nothing to do
     }
     
     public Bus getBus() {
@@ -192,7 +195,7 @@
             try {
                 catalogManager.loadCatalog(new URI(catalogLocation).toURL());
             } catch (Exception e) {
-                e.printStackTrace();
+                e.printStackTrace(err);
                 throw new ToolException(new Message("FOUND_NO_FRONTEND", LOG, catalogLocation));
             }
         }

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolContainer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolContainer.java?rev=796994&r1=796993&r2=796994&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolContainer.java
(original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolContainer.java
Thu Jul 23 09:56:16 2009
@@ -19,6 +19,8 @@
 
 package org.apache.cxf.tools.common.toolspec;
 
+import java.io.OutputStream;
+
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
 
@@ -26,4 +28,6 @@
     void execute(boolean exitOnFinish) throws ToolException;
     void setContext(ToolContext context);    
     void setArguments(String[] args);
+    void setOutOutputStream(OutputStream outOutputStream);
+    void setErrOutputStream(OutputStream errOutputStream);
 }

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolRunner.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolRunner.java?rev=796994&r1=796993&r2=796994&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolRunner.java
(original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolRunner.java
Thu Jul 23 09:56:16 2009
@@ -20,6 +20,7 @@
 package org.apache.cxf.tools.common.toolspec;
 
 import java.io.InputStream;
+import java.io.OutputStream;
 import java.lang.reflect.Constructor;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -38,10 +39,15 @@
                                boolean validate, String[] args) throws Exception {
         runTool(clz, toolspecStream, validate, args, true);
     }
+    
+    public static void runTool(Class<? extends ToolContainer> clz, InputStream toolspecStream,
+                               boolean validate, String[] args, OutputStream os) throws Exception
{
+        runTool(clz, toolspecStream, validate, args, true, null, os);
+    }
 
     public static void runTool(Class<? extends ToolContainer> clz, InputStream toolspecStream,
                                boolean validate, String[] args, ToolContext context) throws
Exception {
-        runTool(clz, toolspecStream, validate, args, true, context);
+        runTool(clz, toolspecStream, validate, args, true, context, null);
     }
 
     public static void runTool(Class<? extends ToolContainer> clz,
@@ -49,7 +55,7 @@
                                boolean validate,
                                String[] args,
                                boolean exitOnFinish) throws Exception {
-        runTool(clz, toolspecStream, validate, args, true, null);
+        runTool(clz, toolspecStream, validate, args, true, null, null);
     }
     
     public static void runTool(Class<? extends ToolContainer> clz,
@@ -58,6 +64,16 @@
                                String[] args,
                                boolean exitOnFinish,
                                ToolContext context) throws Exception {
+        runTool(clz, toolspecStream, validate, args, exitOnFinish, context, null);
+    }
+    
+    public static void runTool(Class<? extends ToolContainer> clz,
+                               InputStream toolspecStream,
+                               boolean validate,
+                               String[] args,
+                               boolean exitOnFinish,
+                               ToolContext context,
+                               OutputStream os) throws Exception {
 
         ToolContainer container = null;
 
@@ -79,6 +95,10 @@
 
         try {
             container.setArguments(args);
+            if (os != null) {
+                container.setErrOutputStream(os);
+                container.setOutOutputStream(os);
+            }
             container.setContext(context);
             container.execute(exitOnFinish);
         } catch (Exception ex) {

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java?rev=796994&r1=796993&r2=796994&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java
(original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java
Thu Jul 23 09:56:16 2009
@@ -21,12 +21,13 @@
 
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
-import java.io.PrintStream;
+import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.StringTokenizer;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerException;
@@ -182,7 +183,9 @@
                                     new StreamSource(Tool.class
                                         .getResourceAsStream("indent-no-xml-declaration.xsl")));
 
-                serializer.transform(new DOMSource(resultDoc), new StreamResult(new PrintStream(System.out)));
+                OutputStream os = new ByteArrayOutputStream();
+                serializer.transform(new DOMSource(resultDoc), new StreamResult(os));
+                LOG.fine(os.toString());
             } catch (Exception ex) {
                 LOG.log(Level.SEVERE, "ERROR_SERIALIZE_COMMAND_MSG", ex);
             }

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/IDLToWSDL.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/IDLToWSDL.java?rev=796994&r1=796993&r2=796994&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/IDLToWSDL.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/IDLToWSDL.java Thu Jul
23 09:56:16 2009
@@ -73,20 +73,20 @@
                 idlProcessor.process();
             }
         } catch (ToolException ex) {
-            System.err.println("Error : " + ex.getMessage());
+            err.println("Error : " + ex.getMessage());
             if (ex.getCause() instanceof BadUsageException) {
                 printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
             }
-            System.err.println();
+            err.println();
             if (isVerboseOn()) {
-                ex.printStackTrace();
+                ex.printStackTrace(err);
             }
             throw ex;
         } catch (Exception ex) {
-            System.err.println("Error : " + ex.getMessage());
-            System.err.println();
+            err.println("Error : " + ex.getMessage());
+            err.println();
             if (isVerboseOn()) {
-                ex.printStackTrace();
+                ex.printStackTrace(err);
             }
             throw new ToolException(ex.getMessage(), ex.getCause());
         }

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/WSDLToIDL.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/WSDLToIDL.java?rev=796994&r1=796993&r2=796994&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/WSDLToIDL.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/WSDLToIDL.java Thu Jul
23 09:56:16 2009
@@ -84,20 +84,20 @@
                 corbaProcessor.process();
             }
         } catch (ToolException ex) {
-            System.err.println("Error : " + ex.getMessage());
+            err.println("Error : " + ex.getMessage());
             if (ex.getCause() instanceof BadUsageException) {
                 printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
             }
-            System.err.println();
+            err.println();
             if (isVerboseOn()) {
-                ex.printStackTrace();
+                ex.printStackTrace(err);
             }
             throw ex;
         } catch (Exception ex) {
-            System.err.println("Error : " + ex.getMessage());
-            System.err.println();
+            err.println("Error : " + ex.getMessage());
+            err.println();
             if (isVerboseOn()) {
-                ex.printStackTrace();
+                ex.printStackTrace(err);
             }
             throw new ToolException(ex.getMessage(), ex.getCause());
         }

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java?rev=796994&r1=796993&r2=796994&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java (original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java Thu
Jul 23 09:56:16 2009
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.tools.java2ws;
 
+import java.io.OutputStream;
 import java.util.Arrays;
 import java.util.List;
 
@@ -76,6 +77,12 @@
         ToolRunner.runTool(JavaToWSContainer.class, JavaToWSContainer.class
                            .getResourceAsStream("java2ws.xml"), false, args);      
     }
+    
+    public void run(OutputStream os) throws Exception {
+        ToolRunner.runTool(JavaToWSContainer.class, JavaToWSContainer.class
+                           .getResourceAsStream("java2ws.xml"), false, args, os);      
+    }
+    
 
     private boolean isExitOnFinish() {
         String exit = System.getProperty("exitOnFinish");

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=796994&r1=796993&r2=796994&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
Thu Jul 23 09:56:16 2009
@@ -78,15 +78,15 @@
             if (ex.getCause() instanceof BadUsageException) {
                 printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
                 if (isVerboseOn()) {
-                    ex.printStackTrace();
+                    ex.printStackTrace(err);
                 }
             }
             throw ex;
         } catch (Exception ex) {
-            System.err.println("Error: " + ex.getMessage());
-            System.err.println();
+            err.println("Error: " + ex.getMessage());
+            err.println();
             if (isVerboseOn()) {
-                ex.printStackTrace();
+                ex.printStackTrace(err);
             }
 
             throw new ToolException(ex.getMessage(), ex.getCause());

Modified: cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java?rev=796994&r1=796993&r2=796994&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java
(original)
+++ cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java
Thu Jul 23 09:56:16 2009
@@ -71,16 +71,16 @@
             if (ex.getCause() instanceof BadUsageException) {
                 printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
             }
-            System.err.println();
-            System.err.println("WSDLToService Error : " + ex.getMessage());
+            err.println();
+            err.println("WSDLToService Error : " + ex.getMessage());
             if (isVerboseOn()) {
-                ex.printStackTrace();
+                ex.printStackTrace(err);
             }
         } catch (Exception ex) {
-            System.err.println();
-            System.err.println("WSDLToService Error : " + ex.getMessage());
+            err.println();
+            err.println("WSDLToService Error : " + ex.getMessage());
             if (isVerboseOn()) {
-                ex.printStackTrace();
+                ex.printStackTrace(err);
             }
         } finally {
             tearDown();

Modified: cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java?rev=796994&r1=796993&r2=796994&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java (original)
+++ cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java Thu
Jul 23 09:56:16 2009
@@ -73,16 +73,16 @@
             if (ex.getCause() instanceof BadUsageException) {
                 printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
             }
-            System.err.println();
-            System.err.println("WSDLToSoap Error : " + ex.getMessage());
+            err.println();
+            err.println("WSDLToSoap Error : " + ex.getMessage());
             if (isVerboseOn()) {
-                ex.printStackTrace();
+                ex.printStackTrace(err);
             }
         } catch (Exception ex) {
-            System.err.println();
-            System.err.println("WSDLToSoap Error : " + ex.getMessage());
+            err.println();
+            err.println("WSDLToSoap Error : " + ex.getMessage());
             if (isVerboseOn()) {
-                ex.printStackTrace();
+                ex.printStackTrace(err);
             }
         } finally {
             tearDown();

Modified: cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java?rev=796994&r1=796993&r2=796994&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java (original)
+++ cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java Thu
Jul 23 09:56:16 2009
@@ -73,16 +73,16 @@
             if (ex.getCause() instanceof BadUsageException) {
                 printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
             }
-            System.err.println();
-            System.err.println("WSDLToXML Error: " + ex.getMessage());
+            err.println();
+            err.println("WSDLToXML Error: " + ex.getMessage());
             if (isVerboseOn()) {
-                ex.printStackTrace();
+                ex.printStackTrace(err);
             }
         } catch (Exception ex) {
-            System.err.println();
-            System.err.println("WSDLToXML Error: " + ex.getMessage());
+            err.println();
+            err.println("WSDLToXML Error: " + ex.getMessage());
             if (isVerboseOn()) {
-                ex.printStackTrace();
+                ex.printStackTrace(err);
             }
         } finally {
             tearDown();

Modified: cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/XSDToWSDL.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/XSDToWSDL.java?rev=796994&r1=796993&r2=796994&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/XSDToWSDL.java (original)
+++ cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/XSDToWSDL.java Thu
Jul 23 09:56:16 2009
@@ -68,16 +68,16 @@
             if (ex.getCause() instanceof BadUsageException) {
                 printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
             }
-            System.err.println();
-            System.err.println("XSDToWSDL Error: " + ex.getMessage());
+            err.println();
+            err.println("XSDToWSDL Error: " + ex.getMessage());
             if (isVerboseOn()) {
-                ex.printStackTrace();
+                ex.printStackTrace(err);
             }
         } catch (Exception ex) {
-            System.err.println();
-            System.err.println("XSDToWSDL Error: " + ex.getMessage());
+            err.println();
+            err.println("XSDToWSDL Error: " + ex.getMessage());
             if (isVerboseOn()) {
-                ex.printStackTrace();
+                ex.printStackTrace(err);
             }
         }
     }



Mime
View raw message