Image

Imagefrd91gt wrote in Imagejava_dev 😡aggravated

Listens: A World So Cold-Mudvayne-The End Of All Things To Come

Java Access Control Exception

error: java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.2.0.13:2345 connect, resolve)



I'm writing a chat server and client and i'm to the point where i'm ready to test it. It works if i use 127.0.0.1 as the IP address but when i use something that isn't local host then i get that error above. Whats up with that? I've tryed doing a little research and I added the following lines to my code:


SocketPermission sp = null;
PermissionCollection pc;
sp = new SocketPermission("192.168.0.13:2345", "connect,resolve");

pc = sp.netPermissionCollection();
pc.add(sp);

I could use a little help here guys I'm desperate for things to try.

Thanks,
-Tony-