With my Java applet I run a HTTP request to http://www.google.fr but the browser displays:
“java.security.AccessControlException: access denied (” java.net.SocketPermission “” http://www.google.fr:80 “” connect, resolve “)”
I signed my applet with :
keytool -genkey -alias keyName
keytool -selfcert -alias keyName
jarsigner appletName.jar keyName
Sometimes I authorize the applet to execute.
But sometimes no pop-up appears with permission.
I load the applet with :
function loadApplet() {
console.log('loadApplet [start]');
$('#applet').html('<applet name="requestApplet" archive="applet.jar" code="GoogleRequest.class" height="10" width="10"></applet>');
console.log(document.requestApplet.methodOfApplet()); // <-- Exception
console.log('loadApplet [finish]');
}
What JRE do you have ? I remember some 1.6 version (.22 if I remember right) had a “security upgrade” regarding networking and after that this kind of oddities started to occur.
Reason for this is that those Applet functions that are public to your javascript cannot call directly network functionalities of JRE. You have to decouple somehow Javascript from your network calls inside applet.
I implemented this with a kind of “message bus”. Javascript calls Applet public function which puts “message” to internal bus, where another applet theread reads it and makes network call. It worked.