1 Reply Latest reply on Apr 15, 2007 11:50 PM by Benjamin Pieritz

    AccessControlException when looking up TopicConnectionFactor

    Benjamin Pieritz Newbie

      Jboss-4.0.5.GA

      Hi there,

      I'm trying to subscribe to to a topic with a client (not running in jboss). However, a lookup results in a:

      AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)

      I can lookup the remote interfaces, so I suspect that this is somehow related to the security settings of TopicConnectionFactory.

      Any ideas?
      Your help is appreciated!


      I set System.setSecurityManager(new RMISecurityManager());

      topicConnectionFactory = (TopicConnectionFactory)
       jndiContext.lookup("TopicConnectionFactory");



      javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: java.security.AccessControlException: access denied (java.net.SocketPermission 230.0.0.4 connect,accept,resolve) [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)]]
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at de.fumbs.test.MessageListenerTest.(MessageListenerTest.java:68)
      at de.fumbs.test.MessageListenerTest.main(MessageListenerTest.java:175)
      Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
      ... 5 more
      Caused by: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
      at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
      at java.security.AccessController.checkPermission(AccessController.java:427)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
      at java.lang.SecurityManager.checkConnect(SecurityManager.java:1034)
      at java.net.Socket.connect(Socket.java:513)
      at java.net.Socket.connect(Socket.java:469)
      at java.net.Socket.(Socket.java:366)
      at java.net.Socket.(Socket.java:266)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:239)
      ... 6 more