AccessControlException access denied FilePermission on codebase

Martin Burger <[email protected]>
Newsgroups gmane.comp.java.sun.rmi
Organization Private account of Martin Burger
Message-ID <[email protected]>
Hello,

I tried the tutorial "Getting Started Using RMI" at
http://java.sun.com/j2se/1.4.2/docs/guide/rmi/getstart.doc.html, but I
run into problems.

I start the HelloImpl using the following VM arguments (my IDE is Eclipse):

-Djava.security.policy=E:/Uni/DiplInf/workspace/RMItest/bin/wideopen.policy
-Djava.rmi.server.codebase=file://E:/Uni/DiplInf/workspace/RMItest/bin/

The policy file contains:

grant {
    // Allow everything for now
    permission java.security.AllPermission;
};


So, all permissions are granted - I think...

But a few seconds after starting HelloImpl the method Naming.rebind()
throws the following Exception:

HelloImpl err: access denied (java.io.FilePermission
\\E\Uni\DiplInf\workspace\RMItest\bin read)
java.security.AccessControlException: access denied
(java.io.FilePermission \\E\Uni\DiplInf\workspace\RMItest\bin read)
    at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
    at
java.security.AccessController.checkPermission(AccessController.java:401)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
    at java.lang.SecurityManager.checkRead(SecurityManager.java:863)
    at java.io.File.exists(File.java:678)
    at sun.net.www.protocol.file.Handler.openConnection(Handler.java:74)
    at java.net.URL.openConnection(URL.java:896)
    at
sun.rmi.server.LoaderHandler.addPermissionsForURLs(LoaderHandler.java:1017)
    at sun.rmi.server.LoaderHandler.access$300(LoaderHandler.java:52)
    at sun.rmi.server.LoaderHandler$Loader.<init>(LoaderHandler.java:1105)
    at sun.rmi.server.LoaderHandler$Loader.<init>(LoaderHandler.java:1086)
    at sun.rmi.server.LoaderHandler$1.run(LoaderHandler.java:861)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.server.LoaderHandler.lookupLoader(LoaderHandler.java:858)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:381)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
    at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:631)
    at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:257)
    at
sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:200)
    at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
    at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
    at
sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:342)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:207)
    at sun.rmi.transport.Transport$1.run(Transport.java:148)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
    at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:534)
    at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
    at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)
    at examples.hello.HelloImpl.main(HelloImpl.java:29)


Do you have any idea for a solution of this problem. I searched the web
and groups using google, but no solution found.

Regards,
    Martin

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.