I'd forgotten this but, months ago, when I was still trying to get my RMI server running, I had to comment this out of the main mehtod of my server:
Coresponding code was commented out on the client-side. It runs great on my Win200 box without it. Is it necessary to set a security manager on the platforms I can't test on? Or more broadly, is there some reason I need to set a security manager that I just haven't yet come across? Thanks, Kirk Maze
Sun Certified Java Developer<br />Sun Certified Java Programmer
Kirk, you do not need to have a security manager. If you did the only place that it works is on the client side. But you will also need a policy file. A Policy file can give allAccess to everything and it will work Mark
Thanks Mark! I got so caught up with my code passing it's final threading tests, that I forgot the policy file completely, and might well have neglected to include one. What a pain that would have been. I posted general thanks to you and Eugene and Peter on another thread. But in the event you miss it, THANKS!, it's probably not apparent to you how much you are helping guys like me who don't post much, but I'm nearly ready to submit a project that has an excellent design, and it's MUCH better than I could have done without the posts you three have made! Thanks from all of us who mostly just read! Kirk Maze
Actually, you don't absolutely need to have a client security policy file: e.g., unless you want to demonstrate the ability to download the RMI stub code, in which case you also likely needin your client startup, and your server startup will have to specify the codebase VM parameter:
Fly by Night Consultants<br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr><i>I climbed on the back of a giant albatross<br />which flew through a crack in the cloud<br />to a place where happiness reigned...<br />all year 'round<br />the music played ever so loudly!</i><p><a href="http://thomasfly.com/songs/Traffic/Hole_in_my_Shoe_qt.htm" target="_blank" rel="nofollow">Hole in My Shoe</a><hr></blockquote>
Just adding another reinforcement to the fact that you do NOT need to do dynamic code downloading for your developer assignment. (Although it *is* the coolest thing ever). So it's perfectly acceptable (unless your assignment tells you otherwise) to simply stick the stub in the client's classpath (stub and any other classes needed for arguments and return values passed across that aren't from the core API). I just didn't want folks to fret too much if they're *not* using dynamic code downloading. The key on the exam is do things in the simplest possible way that still implements the specification on the assignment, and follows good OO design, etc. Doing things more cleverly, or more advanced, at the expense of clear simplicity won't necessarily help and could even hurt. Think of the exam assessor as the end-uesr, and your job is to make his or her life easier : ) cheers, Kathy
Co-Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0596007124/ref=jranch-20" target="_blank" rel="nofollow">"Head First Design Patterns"</a><br /> <br />Just a Jini girl living in a J2EE world.
Thanks Kathy. That is a major point that you can learn in this assignment, is how not to make it overkill and try to build the Taj Mahal. Many programmers in everyday life try to build too much than what is necessary or better yet asked of them. TO the user they want what they ask for and they want it on time. By putting too much you have more chances of missing a deadline, or worse more bugs. Or in these parts Mosquitos. Mark
Joined: Sep 09, 2002
Of course, if you really want to understand RMI and eventually EJBs, it's more than just cool to implement downloadable stubs
Cowgirl and Author
Joined: Oct 10, 2002
Originally posted by Thomas Fly: Of course, if you really want to understand RMI and eventually EJBs, it's more than just cool to implement downloadable stubs
OK, I'm not going to call EJB "more" than cool. But you're right, the "client-does-not-have-the-home-and-component-stubs" problem is the single biggest EJB mistake I've seen beginning EJBers make. Now if you're talkin' Jini -- then NOW we're getting somewhere a whole lot more fun! And in my opinion, the best reason to learn to use dynamic code downloading. Still, I wouldn't necessarily encourage one to learn it by using it IN your developer project, when you have so many other fish to fry. Cheers, Kathy Sun's Bodgitt and Scarper division
Joined: Sep 09, 2002
And I don't know that I'd encourage anybody to force the assessor to duplicate such a setup- but it's kind of nice to say, "And oh, by the way, if you WANT to download the stubs, remove those classes from the client .jar and start the server & clients like this..."
I did not use any security manager and its working well. As requirements does not specify, so i wanted to save time by not using policy file related staffs. Only used a suncertify.properties (not for security at all!).
Ashik Uzzaman Senior Member of Technical Staff, Salesforce.com, San Francisco, CA, USA.