Java Security AccessControlException in Applet -


I'm running into a problem with my applet, it's a URL, and parsing the html there to create an image To do. I have found it to work on my eclipse debugger, however, when I try to use it on a web browser, I get an AccessControlException. I am using the jEditorPane.setPage (url) method. Currently both the applet and the url are hosted on my localhost and I myself had signed the applet.

  java.lang.RuntimeException: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0 .0.1: 80 connect, resolve) sun.net.www.protocol.http. on httpURLConnection.getInputStream (unknown source) .getResponseCode (unknown source java.net.HttpURLConnection on sun.net.www.protocol.http.HttpURLConnection.getHeaderField (unknown source)) javax.swing on com.mindbody.printer.PrinterApplet. JavaxkswingkJEditorPanekgetStream (unknown source javax.swing.JEditorPane.setPage on JEditorPane.setPage) sun.reflect.DelegatingMethodAccessorImpl on java.lang .print (PrinterApplet.java:24) on (unknown source) (unknown source) Sun.reflect.NativeMethodAccessorImpl.invoke0 (original resident method) at sun.reflect.NativeMethodAccessorImpl.invoke on .invoke (application In Trat source) (unknown source). Reflect on sun.refugin.javascript.jsinvoke.invoke at sun.reflect (unknown source). KNativeMethodAccessorImplkinvoke0 (Native Method) SunkreflectkNativeMethodAccessorImplkinvoke (Unknown Source sun.reflect.DelegatingMethodAccessorImpl.invoke on java.lang.reflect.Method.invoke on Sunkplugin) (Unknown Source) (Unknown Source) on .javascript.JSClassLoader.invoke (unknown source) sun.plugin2.liveconnect.JavaClass $ MethodInfo.invoke (unknown source sun.plugin2.liveconnect.JavaClass $ MemberBundle.invoke (unknown source) at sun.plugin2.liveconnect.JavaClass) on .invoke0 (unknown source) sun.plugin2.liveconnect.JavaClass.invoke (unknown source sun.plugin2.main.client.LiveConnectSupport $ PerAppletInfo $ DefaultInvocationDelegate.invoke on sun.plugin2.main.client.LiveConnectSupport) (unknown source) At sun.plugin2.main.cli $ PerAppletInfo $ 3.run (unknown source) per $ .online.plugin2.main.client.LiveConnectSupport $ perAppletInfo.doObjectOp (Unknown Source) on java.security.AccessController.doPrivileged (Native Method) Per.pageConnectSupport PerAppletInfo $ LiveConnectWorker Run (unknown source) and Va.lang.Thread.run (unknown source) on    

An unsigned applet is only allowed to connect to the host and even for signed applets, in the methods implemented with less reliable code (like JavaScript code here), this Switch to only the code of rights (or more exactly, all rights of the intersection).

Your applet's rights are capable of doing everything that wrapped up your code with your code. AccessController.doPrivileged (...) . (But make sure that it can not do dangerous things when giving out the malicious logic from outside.)

Comments