• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

SocketPermission / AccessControlException

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
)
 
Willie Smits can speak 40 languages. This tiny ad can speak only one:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic