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

后端 未结 10 1137

I have a Java Applet inserted on a simple HTML page located at http://localhost:8080/index.html:



        
                      
相关标签:
10条回答
  • 2020-12-03 09:10

    I had the similar issue and it only occurs when I use the "localhost" as a part of the URL for the page with the applet. When I used the URL with the actual host name or IP address as a part of the URL, the problem didn't happen. I am not sure this is a defect for the Java plug-in...

    For example when I used the URL like http://localhost:9080/app_id/appletPage the problem occurred but when I use the URL by using the actual IP or host name, the problem did not occur.

    0 讨论(0)
  • 2020-12-03 09:13

    You should check your virtual directory permissions.

    0 讨论(0)
  • 2020-12-03 09:15

    IIRC, the JavaScript same-origin policy prevents access to same-host/different-port. The PlugIn's LiveConnect enforces this policy for localhost only.

    0 讨论(0)
  • 2020-12-03 09:17

    I encountered the same problem after installing Java 6 Update 22. My applet has been online for several years with no reported errors. When I downgrade to version 6 Update 21, everything works perfect. My applet is not signed.

    SOLUTION: It took me ha while to find the cause of the problem. Actually in my case there were several factors causing the security error. The problem was solved by the crossdomain.xml file. The Java applet tried to download the crossdomain file, failed, and did not even bother to display an error in the java console (debug level 5). Java tried to download the file from the ip adress of my domain (http://ip-address/crossdomain.xml), and not the root of my website (http://domain-name/crossdomain.xml). I guess it is better for the security aspect? I then had to configure the webserver to expose the crossdomainfile on the IP address. In my case I have removed the default website in ISS for security reasons, and had to create a new website. I then discovered that the java applet did not work with the crossdomain files i use with flash:

    <?xml version="1.0"?>
    <cross-domain-policy>
       <site-control permitted-cross-domain-policies="master-only"/>
       <allow-http-request-headers-from domain="*" headers="*"/>
       <allow-access-from domain="*" />
    </cross-domain-policy>
    

    I had to remove the site-control and allow-http-request-headers-from nodes from the xml file in order to make the applet work.

    0 讨论(0)
提交回复
热议问题