Help me to run java agi example?

Hello there,

I am trying to get my sample java program working but get the following
errors.
I am not sure why? However if I run the sample php that comes with
asterisk
I hear the audio and all the tests passes.

Please help.

Best Regards.
prasanth

public class Test1 {

   public static void main( String[] args ) {

       try {

           String linea;

           LineNumberReader in =  new LineNumberReader( new InputStreamReader( System.in ) );

           do { //read AGI environmet

               linea = in.readLine();

           } while ( linea.length() > 0 );

           System.err.println( "SAY NUMBER 123 \"*#\"" );

           linea = in.readLine();

           System.err.println("Received "+linea);

           System.exit( 0 );

       } catch( Exception ex ) {

           System.err.println("Error: "+ex.getMessage());

       }

   }

}

testagi.agi

#!/bin/bash
AGI_DIR=/var/lib/asterisk/agi-bin
JAVA_SCRIPTS=/root/cal/test1.jar
/usr/sbin/java -classpath $AGI_DIR:$JAVA_SCRIPTS Test1

Error message

– Launched AGI Script /var/lib/asterisk/agi-bin/testagi.agi
– AGI Script testagi.agi completed, returning 0