Applet access denied error
I am having a problemn running a java applet. It runs ok on my machine but on the others he shows the folowing java console message:
Exception occurred during event dispatching:
java.security.AccessControlException: access denied (java.net.SocketPermission MyHost 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.protocol.jdk12.http.HttpURLConnection.connectStep1(Unknown Source)
at sun.plugin.protocol.jdk12.http.HttpURLConnection.connect(Unknown Source)
at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:370)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:803)
at Teste.SetDigitalArray(Teste.java:83)
at Teste$2.actionPerformed(Teste.java:62)
at javax.swing.Timer.fireActionPerformed(Unknown Source)
at javax.swing.Timer$DoPostEvent.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
This is how the applet functions:
From a determined time to time, he reads the xml file from the "Xml" host directory(http://MyHost/MyDir/xml/) and with the information in it he draws or not some controls on the applets panel.
The applet runs on the "MyDir" Directory and the images are placed on the "Images" directory(http://MyHost/MyDir/images/).
On my java.security file, i have inserted this following line:
policy.url.3=file:/D:/Testes/Applets/wwwroot/UnifPol
Where UnifPol is configured like that:
grant codeBase "http://ferrari/tstapplet/-" {
permission java.io.FilePermission "<<ALL FILES>>", "read";
};
I have installed the java plugin for Internet Explorer on the machines and the applet tag of the html file have the follow parameters:
codebase=MyInitClass.class archive=SMyJar.jar, jdom.jar,xml-apis.jar,xercesImpl.jar
This works fines on my machine, the same as the host(MyHost) but on the other machines of my local network shows the error above.
After that, i've tried to put some license on the applet using keytool, policytool and jarsigner and generating a keystore called unifkey a Signed applet called SMyJar.jar and a *.cer file.
I've also edited my policy file to the following:
keystore "unifkey";
grant signedBy "AppletUnifilares", codeBase "http://ferrari/tstapplet/-" {
permission java.io.FilePermission "<<ALL FILES>>", "read";
};
The result was the same. It have worked on my machine and generated the exceptions above on the others.
What could it be?
What can i do to make it work for all machines?
thanks,
leokporto

