aspose file tools*
The moose likes Distributed Java and the fly likes Security Exception After Moving RMI Server Jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Security Exception After Moving RMI Server Jar" Watch "Security Exception After Moving RMI Server Jar" New topic
Author

Security Exception After Moving RMI Server Jar

Al Johnston
Ranch Hand

Joined: May 02, 2009
Posts: 99

I am hoping someone can help me figure out how to get my RMI objects running again.

We have a current production system that uses ColdFusion as a controller with RMI serving up objects. The RMI sever Jar was deployed under %java%/jre6/lib/ext directory. When deployed there (with a security file) the RMI server started up and served objects for many months with no complaints.

Now we are migrating away from CF and to Tomcat with no RMI but the same jar files. We were getting exceptions in the code as the Tomcat implementation will not look at the war file for the jar in question. The reason is that the jar file in question was in the ext directory and Java loads those classes first. So, when Tomcat goes looking for classes, it finds the ext classes. That's not right.

I have to have both implementations running. The old one using RMI is in production today. The new one using Tomcat and no RMI is what we hope to replace the production system with once we're done testing. So, to solve this, I moved the jar file for the production system from ext to a new directory I created "deployed_rmi_apps". I modified the security files, start RMI and then start the server. But, when I start the server, I get access errors. Here is how I am starting:



For the security file, it looks like this:



But, when I execute the java commands, the system throws an error once the server gets to "registry.rebind(name,stub)" where name is my server name and stub is UnicastRemoteObject. This was not a problem - everything ran fine - when the jar was in the ext directory. Now all the sudden it does not care what my policy file says. It simply denies me with the following:


FaceBookServer line 789 is the rebind call.

Does anyone know how to solve this? I've tried many things in the policy file and in the startup commands, all to no avail.

Best,
Al
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18993
    
    8

For what it's worth, here's the security policy file for the RMI server running where I work:
Al Johnston
Ranch Hand

Joined: May 02, 2009
Posts: 99

Yep. That did it. Just took out the codebase path and it fired right up. Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Security Exception After Moving RMI Server Jar