Killertechno wrote:Hi guys, I've a trouble using java.
My webserver (on Pi) is using java applet to get data from server (also this running on same Pi).
Cool, this indicate that the applet is working when using IcedTea-web.
your application will work on all Linux and BSD PC's using IcedTea-web.
I access to webpage through browser (on Windows PC), but my java console says:
java.security.AccessControlException: access denied ("java.net.SocketPermission" "192.168.33.2:18000" "connect,resolve")
This indicate that the application do not work when using the proprietary Oracle java deployment plug-in due to how the plugin thinks about security using privileged code blocks and signed binarys using certificates.
I suppose I need to set this exception on server side (right?),
then I need to edit java policy.
I can't find java.policy file, how can I solve this?
You have thee ways to fix this issue:
A: only use systems running icedtea-web since you have verified that it work.
icedtea-web is the only solution that still allow unsigned sandboxed applications and self signed applications which is ideal for hobby projects and enterprise applications running java applications that is expected to work for years to come.
B: obtain a certificate, sign your application and then place the code causing the exception inside a privileged block, example the following code allows you to open a file on the client, same thing with network access.
Code: Select all
File aPrivilegedFile = (File) AccessController.doPrivileged(new PrivilegedAction()
public Object run()
System.out.println("Getting File : " + location);
File outputFile1 = new File(location);
C: You need to change the java.policy settings file stored on the client.
Change the java policy file stored on the client, the Windows PC.
the manual for the java.policy file is found at:
https://docs.oracle.com/javase/8/docs/t ... Files.html
the file is located in the home folder or inside the java run-time directory on the windows pc