File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "SocketPermission / AccessControlException" Watch "SocketPermission / AccessControlException" New topic
Author

SocketPermission / AccessControlException

Stephanie Smith
Greenhorn

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 (java.net.SocketPermission 10.26.12.110:3399 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
SocketPermission:

grant {
permission java.net.SocketPermission "*: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 (java.net.SocketPermission 10.26.12.110:3399 connect,resolve)
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1064)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:258)
at java.security.AccessController.checkPermission(AccessController.java:401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1026)
at sun.rmi.transport.tcp.TCPChannel.checkConnectPermission(TCPChannel.java:119)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:148)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl_Stub.getConnectionId(Unknown Source)
at javax.management.remote.rmi.RMIConnector.getConnectionId(RMIConnector.java:332)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:294)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:247)
at StandAloneMBeanServer2.doesItExist(StandAloneMBeanServer2.java:99)
at StandAloneMBeanServer2.main(StandAloneMBeanServer2.java:40)


ccess: domain that failed ProtectionDomain (null <no certificates>
com.sun.jmx.remote.util.NoCallStackClassLoader@2ba11b
<no principals>
java.security.Permissions@1e328e0 (
(java.net.SocketPermission localhost:1024- listen,resolve)
(java.util.PropertyPermission java.version read)
(java.util.PropertyPermission java.vm.name read)
(java.util.PropertyPermission java.vm.vendor read)
(java.util.PropertyPermission os.name 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 java.specification.name 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 java.vm.specification.name 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)
(java.io.FilePermission 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: http://aspose.com/file-tools
 
subject: SocketPermission / AccessControlException