diff --git a/scr/src/main/java/org/apache/felix/scr/ScrInfo.java b/scr/src/main/java/org/apache/felix/scr/ScrInfo.java
index a26fea8..15343b1 100644
--- a/scr/src/main/java/org/apache/felix/scr/ScrInfo.java
+++ b/scr/src/main/java/org/apache/felix/scr/ScrInfo.java
@@ -18,12 +18,12 @@
  */
 package org.apache.felix.scr;
 
-import java.io.PrintStream;
+import java.io.PrintWriter;
 
 /**
  * Abstraction of command interface.
  * 
- * @Since 1.6.4
+ * @Since 1.8
  */
 public interface ScrInfo
 {
@@ -32,23 +32,23 @@
      * List in text the components for the bundle specified, or all components if null, sorted by component ID
      * @param bundleIdentifier bundle the components are in or null for all components
      * @param out PrintStream for normal output
-     * @param err PrintStream for errors.
+     * @throws IllegalArgumentException if nothing can be found
      */
-    void list(String bundleIdentifier, PrintStream out, PrintStream err);
+    void list(String bundleIdentifier, PrintWriter out);
 
     /**
      * List in text detailed information about the specified components.  Components can be specified by 
      * numeric componentId, component name, a regexp to match for component name, or null for all components.
      * @param componentId specifier for desired components
      * @param out PrintStream for normal output
-     * @param err PrintStream for errors.
+     * @throws IllegalArgumentException if nothing can be found
      */
-    void info(String componentId, PrintStream out, PrintStream err);
+    void info(String componentId, PrintWriter out);
 
     /**
      * List in text the current SCR configuration
      * @param out PrintStream for output.
      */
-    void config(PrintStream out);
+    void config(PrintWriter out);
 
 }
\ No newline at end of file
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java b/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java
index 7dde985..13fab45 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java
@@ -19,6 +19,7 @@
 package org.apache.felix.scr.impl;
 
 import java.io.PrintStream;
+import java.io.PrintWriter;
 import java.lang.reflect.Constructor;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -144,7 +145,7 @@
     /* (non-Javadoc)
      * @see org.apache.felix.scr.impl.ScrInfo#list(java.lang.String, java.io.PrintStream, java.io.PrintStream)
      */
-    public void list(final String bundleIdentifier, final PrintStream out, final PrintStream err)
+    public void list(final String bundleIdentifier, final PrintWriter out)
     {
         Component[] components;
 
@@ -172,8 +173,7 @@
 
             if (bundle == null)
             {
-                err.println("Missing bundle with ID " + bundleIdentifier);
-                return;
+                throw new IllegalArgumentException("Missing bundle with ID " + bundleIdentifier);
             }
             if (ComponentRegistry.isBundleActive(bundle))
             {
@@ -215,14 +215,15 @@
         {
             out.println( String.format( "[%1$4d] [%2$s] [%3$4d] %4$s", component.getId(), toStateString( component.getState() ), component.getBundle().getBundleId(), component.getName() ) );
         }
-    }
+        out.flush();
+   }
 
     /* (non-Javadoc)
      * @see org.apache.felix.scr.impl.ScrInfo#info(java.lang.String, java.io.PrintStream, java.io.PrintStream)
      */
-    public void info(final String componentId, PrintStream out, PrintStream err)
+    public void info(final String componentId, PrintWriter out)
     {
-        Component[] components = getComponentFromArg(componentId, err);
+        Component[] components = getComponentFromArg(componentId);
         if (components == null)
         {
             return;
@@ -394,11 +395,13 @@
                 }
             }
         }
+        out.flush();
     }
 
-    void change(final String componentIdentifier, PrintStream out, PrintStream err, boolean enable)
+    void change(final String componentIdentifier, PrintWriter out, boolean enable)
     {
-        Component[] components = getComponentFromArg(componentIdentifier, err);
+        Component[] components = getComponentFromArg(componentIdentifier);
+        ArrayList<String> disposed = new ArrayList<String>();
         if (components == null)
         {
             return;
@@ -408,7 +411,7 @@
         {
             if ( component.getState() == Component.STATE_DISPOSED )
             {
-                err.println( "Component " + component.getName() + " already disposed, cannot change state" );
+                disposed.add(component.getName());
             }
             else if ( enable )
             {
@@ -435,12 +438,18 @@
                 }
             }
         }
+        out.flush();
+        if ( !disposed.isEmpty() )
+        {
+            throw new IllegalArgumentException( "Components " + disposed + " already disposed, cannot change state" );
+
+        }
     }
 
     /* (non-Javadoc)
      * @see org.apache.felix.scr.impl.ScrInfo#config(java.io.PrintStream)
      */
-    public void config(PrintStream out)
+    public void config(PrintWriter out)
     {
         out.print("Log Level: ");
         out.println(scrConfiguration.getLogLevel());
@@ -481,7 +490,7 @@
         }
     }
 
-    private Component[] getComponentFromArg(final String componentIdentifier, PrintStream err)
+    private Component[] getComponentFromArg(final String componentIdentifier)
     {
         Component[] components = null;
         if (componentIdentifier != null)
@@ -492,7 +501,7 @@
                 Component component = scrService.getComponent(componentId);
                 if (component == null)
                 {
-                    err.println("Missing Component with ID " + componentId);
+                    throw new IllegalArgumentException("Missing Component with ID " + componentId);
                 }
                 else
                 {
@@ -505,10 +514,6 @@
                 
                 // check whether it is a component name
                 components = scrService.getComponents(componentIdentifier);
-                if (components == null)
-                {
-                    err.println("Missing Component with ID " + componentIdentifier);
-                }
             }
         }
         if ( components == null)
@@ -525,6 +530,10 @@
                         cs.add( component );
                     }
                 }
+                if (cs.isEmpty())
+                {
+                    throw new IllegalArgumentException("No Component with ID or matching " + componentIdentifier);
+                }
                 components = cs.toArray( new Component[cs.size()] );
             }
         }
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/ScrGogoCommand.java b/scr/src/main/java/org/apache/felix/scr/impl/ScrGogoCommand.java
index 838c82c..3a12e87 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/ScrGogoCommand.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/ScrGogoCommand.java
@@ -18,6 +18,8 @@
  */
 package org.apache.felix.scr.impl;
 
+import java.io.PrintWriter;
+
 import org.apache.felix.service.command.Descriptor;
 
 /**
@@ -57,37 +59,72 @@
     @Descriptor("List all components")
     public void list()
     {
-        scrCommand.list(null, System.out, System.err);
+        try
+        {
+            scrCommand.list(null, new PrintWriter(System.out));
+        }
+        catch ( IllegalArgumentException e )
+        {
+            System.err.println(e.getMessage());
+        }
     }
 
     @Descriptor("List components of a specific bundle")
     public void list(@Descriptor("Symbolic name or ID of the bundle") final String bundleIdentifier)
     {
-        scrCommand.list(bundleIdentifier, System.out, System.err);
+        try
+        {
+            scrCommand.list(bundleIdentifier, new PrintWriter(System.out));
+        }
+        catch ( IllegalArgumentException e )
+        {
+            System.err.println(e.getMessage());
+        }
     }
 
     @Descriptor("Dump information of a component")
     public void info(@Descriptor("Name or ID of the component") final String componentIdentifier)
     {
-        scrCommand.info(componentIdentifier, System.out, System.err);
+        try
+        {
+            scrCommand.info(componentIdentifier, new PrintWriter(System.out));
+        }
+        catch ( IllegalArgumentException e )
+        {
+            System.err.println(e.getMessage());
+        }
     }
 
     @Descriptor("Enable a disabled component")
     public void enable(@Descriptor("Name or ID of the component") final String componentIdentifier)
     {
-        scrCommand.change(componentIdentifier, System.out, System.err, true);
+        try
+        {
+            scrCommand.change(componentIdentifier, new PrintWriter(System.out), true);
+        }
+        catch ( IllegalArgumentException e )
+        {
+            System.err.println(e.getMessage());
+        }
     }
 
     @Descriptor("Disable an enabled component")
     public void disable(@Descriptor("Name or ID of the component") final String componentIdentifier)
     {
-        scrCommand.change(componentIdentifier, System.out, System.err, false);
+        try
+        {
+            scrCommand.change(componentIdentifier, new PrintWriter(System.out), false);
+        }
+        catch ( IllegalArgumentException e )
+        {
+            System.err.println(e.getMessage());
+        }
     }
 
     @Descriptor("Show the current SCR configuration")
     public void config()
     {
-        scrCommand.config(System.out);
+        scrCommand.config(new PrintWriter(System.out));
     }
 
 }
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/ScrShellCommand.java b/scr/src/main/java/org/apache/felix/scr/impl/ScrShellCommand.java
index c77331c..b7045ee 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/ScrShellCommand.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/ScrShellCommand.java
@@ -19,6 +19,7 @@
 package org.apache.felix.scr.impl;
 
 import java.io.PrintStream;
+import java.io.PrintWriter;
 import java.util.StringTokenizer;
 import org.apache.felix.shell.Command;
 
@@ -84,29 +85,37 @@
         else
         {
             String arg = (st.hasMoreTokens()) ? st.nextToken() : null;
-            if (command.equals(LIST_CMD))
+            PrintWriter pw = new PrintWriter(out);
+            try
             {
-                scrCommand.list(arg, out, err);
+                if (command.equals(LIST_CMD))
+                {
+                    scrCommand.list(arg, pw);
+                }
+                else if (command.equals(INFO_CMD))
+                {
+                    scrCommand.info(arg, pw);
+                }
+                else if (command.equals(ENABLE_CMD))
+                {
+                    scrCommand.change(arg, pw, true);
+                }
+                else if (command.equals(DISABLE_CMD))
+                {
+                    scrCommand.change(arg, pw, false);
+                }
+                else if (command.equals(CONFIG_CMD))
+                {
+                    scrCommand.config(pw);
+                }
+                else
+                {
+                    err.println("Unknown command: " + command);
+                }
             }
-            else if (command.equals(INFO_CMD))
+            catch ( IllegalArgumentException e )
             {
-                scrCommand.info(arg, out, err);
-            }
-            else if (command.equals(ENABLE_CMD))
-            {
-                scrCommand.change(arg, out, err, true);
-            }
-            else if (command.equals(DISABLE_CMD))
-            {
-                scrCommand.change(arg, out, err, false);
-            }
-            else if (command.equals(CONFIG_CMD))
-            {
-                scrCommand.config(out);
-            }
-            else
-            {
-                err.println("Unknown command: " + command);
+                System.err.println(e.getMessage());
             }
         }
     }
