commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kherzi Samir" <>
Subject [Commons Launcher] - Read a line from is blocking
Date Wed, 15 Jun 2005 15:41:04 GMT

I've notice a bug (or somthing that looks like) using Commons Launcher on Unix (HP-UX 11,
Sun Solaris 8, Linux) with a JRE 1.4.2. I use in my code a method that wait for a user
input from
   // read a line on the console
   public static String console() throws IOException
      InputStreamReader isr = new InputStreamReader(;
      BufferedReader br = new BufferedReader(isr);
      String line = br.readLine();
      return line;

When I call consecutively this method many times, the prompt seems to
wait infinitly:
   String myString = null;
   System.out.print("1 - Enter something: "); myString = console();
   System.out.print("2 - Enter something: "); myString = console();
   System.out.print("3 - Enter something: "); myString = console();

To unlock the console() return call, I have to type on the << return >> keyboard
many times to take my input from the command line.

This never happens when I execute my code outside a Commons Launcher script.
This never happens too on my Windows (Windows 2000, jre 1.4.2).

Please find at this URL the complete test:
 >    <

You will find in this package the following files that will help to
reproduce the problem:
  ant.jar                   : the ant jar
  ant-launcher.jar          : the ant launcher jar
  commons-launcher.jar      : the commons launcher jar
  xercesImpl.jar            : the xerces jar
  xml-apis.jar              : the xml api jar

  LauncherBootstrap.class   : the class from commons       : the properties to find ant jars
  launcher.xml              : the ant project  : the source code of console()
  TestCommonsLauncher.class : the class of console                : the script to compile (unix)
  compile.bat               : the script to compile (win32)                     : script shell to launch classicaly the test (unix)             : script shell to launch the test using Commons Launcher (unix)
  go.bat                    : script shell to launch classicaly the test (win32)
  go_usingCL.bat            : script shell to launch the test using Commons Launcher (win32)

Best regards,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message