1 Reply Latest reply on Apr 6, 2004 3:01 AM by Peter Korsten

    Access control exception is thrown when applet is downloaded

    paragsagdeo Newbie

      I m trying to access applet using http://localhost:8080/mine/TestApplet.html, the applet is properly downloaded but it cannot look up bean and throws exception
      ---------------------------------------------------------------------
      javax.naming.ServiceUnavailableException: Unexpected failure [Root exception is java.security.AccessControlException: access denied (java.net.SocketPermission paragxp:8080 connect,resolve)]

      at org.jboss.naming.interceptors.ExceptionInterceptor.invoke(ExceptionInterceptor.java:56)

      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)

      at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:55)

      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)

      at $Proxy0.lookup(Unknown Source)

      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)

      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)

      at javax.naming.InitialContext.lookup(Unknown Source)

      at testclient.ServerManager.lookup(ServerManager.java:74)

      at testclient.ServerManager.(ServerManager.java:55)

      at testclient.ServerManagerFactory.getServerManager(ServerManagerFactory.java:28)

      at testclient.gui.TestApplet.initialise(TestApplet.java:260)

      at testclient.gui.TestApplet.init(TestApplet.java:180)

      at sun.applet.AppletPanel.run(Unknown Source)

      at java.lang.Thread.run(Unknown Source)

      Caused by: java.security.AccessControlException: access denied (java.net.SocketPermission paragxp:8080 connect,resolve)

      at java.security.AccessControlContext.checkPermission(Unknown Source)

      at java.security.AccessController.checkPermission(Unknown Source)

      at java.lang.SecurityManager.checkPermission(Unknown Source)

      at java.lang.SecurityManager.checkConnect(Unknown Source)

      at sun.plugin.net.protocol.http.HttpURLConnection.checkPermission(Unknown Source)

      at sun.plugin.net.protocol.http.HttpURLConnection.connect(Unknown Source)

      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)

      at org.jboss.invocation.http.interfaces.Util.invoke(Util.java:101)

      at org.jboss.invocation.http.interfaces.HttpInvokerProxy.invoke(HttpInvokerProxy.java:102)

      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:96)

      at org.jboss.naming.interceptors.ExceptionInterceptor.invoke(ExceptionInterceptor.java:42)
      ----------------------------------------------------------------------------
      But when I access the applet using http://parag:8080/mine/TestApplet.html the lookup is done properly and the applet is started (parag is name of my computer).

      Can someone please tell me why accessing from localhost throws AccessControlException.

      Thanks and Regards,
      Parag