This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Why does AccessControlException happen? Please help me! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Why does AccessControlException happen? Please help me!" Watch "Why does AccessControlException happen? Please help me!" New topic
Author

Why does AccessControlException happen? Please help me!

heo kangwuk
Greenhorn

Joined: Nov 01, 2002
Posts: 1
To me accessControlException : Access denied(java.io.FilePermission \scjd read)
set classpath=;
start rmiregistry
set classpath=c:\scjd\Server.jar
---------- next --------------
java -Djava.rmi.server.codebase=file://c:\scjd/
-Djava.security.policy=remote.policy suncertify.server.Server c:\scjd\db.db
my policy file is
grant {
permission java.security.AllPermission;
};
Because upside policy file becomes error, is not measuring with a toe although it did establishing variously
grant {
permission java.net.SocketPermission "*:1024-65535", "connect, accept, resolve";
permission java.net.SocketPermission "*:80", "connect, accept";
permission java.io.FilePermission "<>","read, execute, write";
};

I found all forum to catch error, but there was no number of egg at all.
Is no there method to solve?
Help just


kangwuk heo<br />Sun Certified Java 2 Programmer<br />Sun Certified Web Component Developer<br />Sun Certified Java Developer
Charles Dupin
Ranch Hand

Joined: Oct 18, 2002
Posts: 94
Heo,
Are you running an applet? In which case the AppletViewer.policy must be:
grant {
permission java.security.AllPermission;
permission java.net.SocketPermission "*", "accept, connect, listen, resolve";
};
Good luck.
C.


Charles.<br />(SCJD2)
Mag Hoehme
Ranch Hand

Joined: Apr 07, 2002
Posts: 194
Hi Heo,
eventually I circumvented all this security stuff by simply *NOT* implementing a security manager - and it worked fine. The only thing you have to take is that the client has all the server stubs in its classpath.
Hope this helps.


Mag
Mag Hoehme
Ranch Hand

Joined: Apr 07, 2002
Posts: 194
Hi Heo,
are you sure that your policy file has "<>" instead of "<<ALL FILES>>"? java.io.FilePermission checks the string for equality:

Remember, the security manager won't let you know if something is wrong with the security file itself.
Hope this helps.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why does AccessControlException happen? Please help me!
 
Similar Threads
AccessControlException
AccessControlException
AccesscontrolException
SocketPermission / AccessControlException
AccessControlException