Frank Liu

Greenhorn
+ Follow
since Mar 03, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Frank Liu

I also want to know it.Who can tell.Thanks a lot.
This report shows the total points that could have been awarded in each section and the actual number of points you were awarded. This is provided to give you per-section feedback on your strengths. The maximum possible number of points is 155; the minimum to pass is 124. Section Summary Report: General Considerations: Maximum=58 Deductions=6 Actual=52 Documentation: Maximum=20 Deductions=0 Actual=20 GUI: Maximum=24 Deductions=9 Actual=15 Server: Maximum=53 Deductions=3 Actual=50 Total: Maximum=155 Deductions=18 Certification Score=137
oh~~~~~~~only got 15 for GUI,555555555555555
22 years ago
I tried on the same computer,it worked.Didn't try on the LAN.
I sent the server.jar to my friend,and I want to connect the client to the server via Internet.
but I failed.
I use this to connect:
ServerInterface myServerObject = (ServerInterface) Naming.lookup("rmi://61.171.20.38/remoteData");
and get this Exception:
java.rmi.ConnectException: Connection refused to host: 10.123.123.199; nested exception is:
java.net.ConnectException: Connection timed out: connect
Why the host change to 10.123.123.199,I don't what it is.
I used "telnet 61.171.20.38 1099" to see if the server is up.It's ok.
The server command line is java -jar -Djava.rmi.server.codebase=file:/e:\java\server.jar server.jar 61.171.20.38 .
The server use this to bind itself:
Naming.rebind("rmi://61.171.20.38/remoteData", new Server());
Are there any thing wrong.
I also tried add -Djava.security.policy=Server.policy
,but failed either.
javadoc source documentation (5)
comments (5)
what the second comments mean?
Need I write comments in the methods besides javadoc style comments?
then are there any styles about the comments in the methods?
Does it need to generate RMI stub?If need ,then every public method in it should throw RemoteException.RemoteDataImpl has the same interface (DataInterface) as Data.The method in Data no need to throw RemoteException.Then how can I define DataInterface?
my getRomoteData() in RemoteDataFactory is like this:
public DataInterface getRemoteData() throws RemoteException {
DataInterface remoteData = null;
try{
remoteData = new RemoteData(data);
//data is an instance of Data.
}
catch(Exception e){
e.printStackTrace();
}
return remoteData;
}
and RemoteData is something like:
public class RemoteData implements DataInterface,Remote{
private DataInterface data;
public RemoteData(DataInterface data) throws RemoteException,IOException{
this.data = data;
}
....
}


Originally posted by Nate Johnson:
main
1) create a "local" database on the server (Data)
2) pass that ref to my RemoteDataFactory (constructor) so it can keep a copy when getConn is called on it (which it turn creates a new RemoteData based on that database)
3) bind that RemoteDataFactory to the registry
end main
So, now in the client, get a ref to RemoteDataFactory (from Naming) when a remote connection is requested and call getConn. This will return a RemoteData object that has all of the methods that can access that "local" Data that was created back on the server. Each client can do this when it starts in remote mode and then be talking to the same Data, but with a unique RemoteData (which in turn can be used as the id for locking).


I just want to know how to "creates a new RemoteData based on that database".
RemoteData can't get the ref of database(Data) from its constructor.
public RemoteData(Data data) can't work for Data can't be Serialized,then how can I use Data in the RemoteData?How can I pass the ref in the RemoteDataFactory to the RemoteData?