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


Ronnie Phelps
Ranch Hand

Joined: Mar 12, 2001
Posts: 329
I'm having trouble starting my server. Here are the contents of my policy file.

grant {;

This is how I execute the command:

java learning.rmi.Request

Here's the exception I get error parsing file:C:/learning/rmi/java.policy line 2: expected permission entry
Exception in thread "main" access denied ( connect,resolve)
at Source)
at Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at<init>(Unknown Source)
at<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Unknown Source)
at learning.rmi.Request.main(
john d

Joined: Jul 11, 2002
Posts: 9
you need to put "permission" in front of the call like this!
grant {
// Allow everything for now
hope it helps
Ronnie Phelps
Ranch Hand

Joined: Mar 12, 2001
Posts: 329
Thanks John. I had already figured it out but I guess i chosed the wrong forum to post it in, because "Distributed java" doesn't seem to be very popular. Thanks anyway dude.
I agree. Here's the link:
subject: AccessControlException
It's not a secret anymore!