commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arnaud HERITIER" <aherit...@gmail.com>
Subject RE: [Commons Launcher] - Read a line from System.in is blocking
Date Wed, 15 Jun 2005 21:50:51 GMT
Ca c'est pro ;-)

A++

-------------------------------
Arnaud HERITIER
-------------------------------
Private      : aheritier@gmail.com
Opensource   : aheritier@apache.org
Professional : aheritier@axway.com
-------------------------------
 

> -----Message d'origine-----
> De : Kherzi Samir [mailto:skherzi@axway.com] 
> Envoyé : mercredi 15 juin 2005 17:41
> À : commons-user@jakarta.apache.org
> Objet : [Commons Launcher] - Read a line from System.in is blocking
> 
> Hi,
> 
> 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 System.in:
> ----------------------------------------------------------------------
>    // read a line on the console
>    public static String console() throws IOException
>    {
>       InputStreamReader isr = new InputStreamReader(System.in);
>       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 key 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:
>  >    http://samir.kherzi.free.fr/TestCommonsLauncher.tar    <
> 
> 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
>   launcher.properties       : the properties to find ant jars
>   launcher.xml              : the ant project
> 
>   TestCommonsLauncher.java  : the source code of console()
>   TestCommonsLauncher.class : the class of console
> 
>   compile.sh                : the script to compile (unix)
>   compile.bat               : the script to compile (win32)
> 
>   go.sh                     : script shell to launch 
> classicaly the test (unix)
>   go_usingCL.sh             : 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,
> Samir KHERZI.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message