Charlie Hubbard

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

Recent posts by Charlie Hubbard

-Djava.security.policy=RMISecurity.policy
Your problem is in this policy file. You probably need to edit it to setup the correct permissions to associate with your application. Since RMI is loading code remotely you need to protect the client for a malicious server sending you bad code (security hole central). This looks like an example program maybe your tutorial has more info on how to properly edit this file so this example will run. You can try since this is just a simple example program:
grant {
java.security.AllPermissions;
}
This is NOT secure for production though.
charlie
23 years ago

Originally posted by Michael Morris:
Hi All,
The javadoc for DGC.dirty() states the following:

The client must also make a dirty call to renew leases on remote references before such leases expire. When the client no longer has any references to a specific remote object, it must schedule a clean call for the object ID associated with the reference.

How does one insure that the lease does not expire on a remote reference before the client is ready to relinquish it? How does one acquire a DGC reference on a remote VM in order to check the lease information? The API docs on java.rmi.dgc are not very helpful on these subjects and despite many futile searches, I am no closer to understanding them.
Thanks in advance for your help
Michael Morris
SCJP2


One does not need to worry lease expiration from a clients perspective. If a client has a reference to a remote object then DGC lease renewal happens automatically. There is no need to renew the lease yourself. To get rid of an object simply drop your reference to the remote object. When the stub object is GC'ed then the renewal of the lease will cease, and the remote object will be GC'ed itself. (That is provided no other clients have a reference to that remote object--remember--RMI Registry counts as one).
charlie
23 years ago

Originally posted by karthik Guru:
When we have a remote server object that extend UnicastRemoteObject, it waits for clients to connect to it instead of exiting.
If the count of client references to the remote object reduces to zero, the server object is eligible for GC??
if that is so the thread exits because the server object w'd b GCed?

I hope if i run System.gc() in my unrefereced method, the remote object will be GCed??
Does my registry hold on to the remote object reference in some way?? if that is the case do i need to call unbind() on the remote object?
am


RMI Registry counts as one client so if you have an RMI object that exists in the RMI registry then it will not be GC'ed. Doing an unbind() will remove that object from the RMI registry and allow it to be GC'ed after all clients drop their remote references to it.
charlie
23 years ago
Here is the URL for JCE
http://java.sun.com/products/jce/
If you're running JDK1.4 you don't need to download it.
charlie
23 years ago

Originally posted by netharam ram:
Hi, I want to encrypt a text & save it to file,which should not be human readable or easily understandable.In my application I want to read the file & decrypt the text.Please reply with some code if possible.
Happy middling with java.
Netharam.


You can use JCE for any sort of encryption that you would like to perform. Look at the JCE documentaion in the appendicies for an example of PBE (password based encryption). That you get you started.
charlie
23 years ago