my dog learned polymorphism
The moose likes Distributed Java and the fly likes SocketPermission / AccessControlException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "SocketPermission / AccessControlException" Watch "SocketPermission / AccessControlException" New topic

SocketPermission / AccessControlException

Stephanie Smith

Joined: Jun 28, 2001
Posts: 22
I am using a JMX RMI connector.

When I try to connect, I am getting a AccessControlException
access: access denied ( connect,resolve)

I am using a SecurityManager and I have a policy file. I am only granting permissions to those needed.

The only way I can get this to work is to grant everyone this

grant {
permission "*:1024-65535", "connect,accept,resolve";


My QUestion is this:
If I try to grant this to a specific codebase or principal, i always get the exception. Is it required that this SocketPermission be granted to everyone?

As an fyi, here is the traceback to give you some context,

access: access denied ( connect,resolve)
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(
at java.lang.SecurityManager.checkPermission(
at java.lang.SecurityManager.checkConnect(
at sun.rmi.transport.tcp.TCPChannel.checkConnectPermission(
at sun.rmi.transport.tcp.TCPChannel.newConnection(
at sun.rmi.server.UnicastRef.invoke(
at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
at Source)
at StandAloneMBeanServer2.doesItExist(
at StandAloneMBeanServer2.main(

ccess: domain that failed ProtectionDomain (null <no certificates>
<no principals> (
( localhost:1024- listen,resolve)
(java.util.PropertyPermission java.version read)
(java.util.PropertyPermission read)
(java.util.PropertyPermission java.vm.vendor read)
(java.util.PropertyPermission read)
(java.util.PropertyPermission java.vendor.url read)
(java.util.PropertyPermission java.vm.specification.vendor read)
(java.util.PropertyPermission java.specification.vendor read)
(java.util.PropertyPermission os.version read)
(java.util.PropertyPermission read)
(java.util.PropertyPermission java.class.version read)
(java.util.PropertyPermission file.separator read)
(java.util.PropertyPermission java.vm.version read)
(java.util.PropertyPermission os.arch read)
(java.util.PropertyPermission read)
(java.util.PropertyPermission java.vm.specification.version read)
(java.util.PropertyPermission java.specification.version read)
(java.util.PropertyPermission java.vendor read)
(java.util.PropertyPermission path.separator read)
(java.util.PropertyPermission line.separator read)
( C:/j2sdk1.4.2_05/Jre/lib/ext/x86/QProfJ.dll read)
(java.lang.RuntimePermission loadLibrary.QProfJ)
(java.lang.RuntimePermission stopThread)
I agree. Here's the link:
subject: SocketPermission / AccessControlException
It's not a secret anymore!