File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMISecurityManager Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMISecurityManager" Watch "RMISecurityManager" New topic


Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Has anyone out there ever got the impression that either no one really knows why the rmiregistry exhibits random flakiness or they're trying to keep the rest of us in the dark?
Everything that I've read says to install an RMISecurityManager on the server, nothing is ever said about nor have I seen any code to indicate that it is necessary to install an RMISecurityManager on the client. I just wrote a simple test application that will only run with the RMISecurityManager installed on the client (it doesn't matter whether you install one on the server or not.) The client runs fine if the remote object stub is in its CLASSPATH, but if it has to download the stub from the codebase, without the RMISecurityManager it throws a security exception. The server codebase is set to:http://localhost:8080/RMI/Server/ since I have Tomcat running on the local machine.
Can anyone give me (or guide me to) a definitive understanding of this?

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
James Du
Ranch Hand

Joined: Mar 23, 2001
Posts: 186
Hi Michael,
As what I understand, RMISecurityManager must be installed at the side which intend to download the stub class from the other. that applies to both sides despite its being server or client.
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Yea James I'd pretty much figured that out. What upsets me is that of all the books I've read that covered RMI (I'm 100% self-taught in JAVA) which are four, some of the authors being Sun employees, not one nailed this issue down. None ever show the installation of a securtity manager on the client side, nor do they explain how RMI actually works. They just show you how to make the calls.
I've been programming for about 30 years and it always comes down to this: If you really want to understand something you just have to experiment with some code until you get it.
I do appreciate the information though.
Michael Morris
I agree. Here's the link:
subject: RMISecurityManager
jQuery in Action, 3rd edition