Image

Imagecrasherkiddy wrote in Imagejava_dev hopeless

RMI

:( Java really isn't my language lol, i'm not having much luck with something i'm trying to get going in java RMI tbh i think my understanding of it is completly wrong. It'd be great if anyone could message me on msn and give me a quick hand (drziggy@hotmail.com). I'll trying and explain as best i can here.

I make a call from a user class like so....

try {

Account userAccount = pr.getAccount(accountNumber);
//userBalance = userAccount.getBalance();

}catch(RemoteException remoteException) {

System.err.println(remoteException);
System.exit(1);

}

... pr is the UnicastRemoteObject, this should in my mind return a whole hash table (which is an account) and put it in userAccount allowing me to call any of the functionality for that account e.g. userAccount.getBalance() etc however it doesn't i get a NullPointerException like it doesn't exist. What it does allow me to do is run them within the try so the line that is commented out actually works. Thing is then i just make one connection retrieving all of the variables i need, after that i need to edit the variables and update them on the server side, i can't do this though because i can't access the function i need in userAccount. Does that make sense?!

I'm completely lost here, spent ages trying to get my head around it.