I have a problem that started occuring after I updated Java (I think) When I try and connect to my Cpp server (that seems to work just fine) I get an error message I can't find any help with.
Below are the error messages
java.security.AccessControlException: access denied
("java.net.SocketPermission" "127.0.0.1:4000" "connect,resolve")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:366)
at java.security.AccessController.checkPermission(AccessController.java:555)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1051)
at java.net.Socket.connect(Socket.java:574)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at jclientbare.init(jclientbare.java:27)
at sun.applet.AppletPanel.run(AppletPanel.java:434)
at java.lang.Thread.run(Thread.java:722)
The Java source code follows
import java.awt.*;
import java.applet.*;
import java.io.*;
import java.net.*;
import javax.swing.*;
public class jclientbare extends Applet {
static BufferedReader in;
static PrintStream out;
public void init() {
try {
System.out.println("Test NN");
Socket socket = new Socket( "localhost", 4000 );
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
out = new PrintStream( socket.getOutputStream(), true);
}
catch (UnknownHostException e) {
JOptionPane.showMessageDialog(null, "Unknown Host..");
System.out.println("Unknown host: kq6py");
} catch (IOException e) {
JOptionPane.showMessageDialog(null, "NO IO.");
System.out.println("No I/O");
}
}
}
The Java applet doesn't register a connection it just bombs with the error message. Any help would be appreciated! I think it may be a issue with the java.policy but I don't know exactly how to fix it.
Uhh, how do you do a stack trace?