Hi
habe folgende code :
Mein frage ist folgendes:
warum bricht das programm ab wenn ich test3() auffuehre ??
MAch ich etwas falsch mit BufferedReader??
Danke
Mitch_P
habe folgende code :
Code:
package oks.meetMe1.client;
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.RemoteException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class MeetMeMenu {
public static void main(String[] args) throws RemoteException, MalformedURLException{
URL gsh = new java.net.URL("http://192.168.0.6:9080/ogsa/services/oks/meetMe/MeetMeSessionFactoryService");
EasyClient client= new EasyClient(gsh);
String login ="";
String password="";
/*
try {
System.out.println( " plz enter login ");
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
login = in.readLine();
System.out.println( " plz enter password");
password = in.readLine();
in.close();
}
catch(Exception e){
System.out.println(" login error ");
}
*/
// wenn ich test3() weg mache dann geht es!!!
test3();
test2( login , password , gsh);
}
public static void test3(){
String login="";
String password="";
try {
System.out.println( " plz enter login ");
BufferedReader in2 = new BufferedReader(new InputStreamReader(System.in));
login = in2.readLine();
System.out.println( " plz enter password");
password = in2.readLine();
in2.close();
}
catch(Exception e2){
System.out.println(" login error ");
}
}
public static void test2(String login , String password , URL gsh) throws RemoteException{
EasyClient client= new EasyClient(gsh);
if(client.login( "5550003" , "geheim")){
menu(client);
}
}
public static void menu(EasyClient client) throws RemoteException{
System.out.println(" plz enter user ID");
System.out.println(" her er jeg ");
try {
System.out.println(" her er jeg ");
// heir bricht er ab , warum??????
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String cmd = in.readLine();
System.out.println(" her er jeg ");
test(client, cmd);
in.close();
System.out.println(" her er jeg ");
}
catch (Exception e) {
System.out.println("command error");
}
}
public static void test(EasyClient client , String id) throws RemoteException{
client.addUsers("5550002");
client.addUsers("5550000");
client.addUsers("5551213");
client.listUsers();
menu(client);
}
}
warum bricht das programm ab wenn ich test3() auffuehre ??
MAch ich etwas falsch mit BufferedReader??
Danke
Mitch_P