DanJW
asked on
Properties 'load' function
Basically, this code snippet gets to the bit where is says "It gets here 2", what am I doing wrong?
{
private Properties userInfo;
private BufferedWriter out;
private BufferedReader in;
private MsgSvrConnection conn;
public void execute() throws IOException
{
String sender = conn.getCurrentUser();
String recipient = in.readLine();
String content = in.readLine();
FileInputStream fin = null;
System.out.println("It gets here 1");
try{
fin = new FileInputStream(MsgProtoco l.PASSWORD _FILE);
System.out.println("It gets here 2");
userInfo.load(fin);
System.out.println("It gets here 3");
System.out.println(userInf o.getPrope rty(recipi ent)+" recipient");
}catch(IOException e)
.............blah blah
{
private Properties userInfo;
private BufferedWriter out;
private BufferedReader in;
private MsgSvrConnection conn;
public void execute() throws IOException
{
String sender = conn.getCurrentUser();
String recipient = in.readLine();
String content = in.readLine();
FileInputStream fin = null;
System.out.println("It gets here 1");
try{
fin = new FileInputStream(MsgProtoco
System.out.println("It gets here 2");
userInfo.load(fin);
System.out.println("It gets here 3");
System.out.println(userInf
}catch(IOException e)
.............blah blah
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please check that it is being allocated elsewhere (which it possibly is) before execute() is called. If so, please disregard my previous comment. :-)
>>>
try{
fin = new FileInputStream(MsgProtoco l.PASSWORD _FILE);
System.out.println("It gets here 2");
userInfo.load(fin);
System.out.println("It gets here 3");
System.out.println(userInf o.getPrope rty(recipi ent)+" recipient");
}catch(IOException e)
.............blah blah
>>
change the exception handler to:
}catch(Exception e)
e.printStackTrace();
}
and post the exception stack trace
try{
fin = new FileInputStream(MsgProtoco
System.out.println("It gets here 2");
userInfo.load(fin);
System.out.println("It gets here 3");
System.out.println(userInf
}catch(IOException e)
.............blah blah
>>
change the exception handler to:
}catch(Exception e)
e.printStackTrace();
}
and post the exception stack trace
ASKER
Ha ha, just shows you how sometimes the simplest things are often overlooked. I feel ashamed.