Omnimaga

General Discussion => Technology and Development => Computer Programming => Topic started by: Snake X on August 08, 2011, 04:40:44 pm

Title: permissions DENIED!
Post by: Snake X on August 08, 2011, 04:40:44 pm
This line: Clipboard clipboard = getToolkit().getSystemClipboard();

will not let my applet work. it gives this:

Code: [Select]
--------------------Configuration: link generator - JDK version 1.6.0_26 <Default> - <Default>--------------------
java.security.AccessControlException: access denied (java.awt.AWTPermission accessClipboard)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkSystemClipboardAccess(SecurityManager.java:1377)
at sun.awt.windows.WToolkit.getSystemClipboard(WToolkit.java:650)
at link_generator.<init>(link_generator.java:16)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:785)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:714)
at sun.applet.AppletPanel.run(AppletPanel.java:368)
at java.lang.Thread.run(Thread.java:662)

Process completed.

edit: and yes i have tried looking this up.
Title: Re: permissions DENIED!
Post by: jnesselr on August 08, 2011, 04:47:43 pm
your problem is that the applet is in a sandboxed environment.

Look here (http://download.oracle.com/javase/tutorial/deployment/applet/security.html) right under where it says "Unsigned applets cannot perform the following operations:"

Also, check out this page (http://download.oracle.com/javase/tutorial/deployment/applet/problemsindex.html) for common applet problems.
Title: Re: permissions DENIED!
Post by: AngelFish on August 08, 2011, 04:48:55 pm
It looks like you're trying to access something improperly. First of all, you should check that your types are all in order. Also, make sure that you have something in the clipboard beforehand to test it with. Some systems respond differently when the clipboard is empty.

EDIT: Graphmastur is right.
Title: Re: permissions DENIED!
Post by: jnesselr on August 08, 2011, 04:50:26 pm
It looks like you're trying to access something improperly. First of all, you should check that your types are all in order. Also, make sure that you have something in the clipboard beforehand to test it with. Some systems respond differently when the clipboard is empty.

EDIT: Graphmastur is right.
and graphmastur is a ninja!
Title: Re: permissions DENIED!
Post by: AngelFish on August 08, 2011, 04:51:23 pm
/me was double Ninja'd
/me uses !quote 100
Title: Re: permissions DENIED!
Post by: jnesselr on August 08, 2011, 04:52:01 pm
/me was double Ninja'd
/me uses !quote 100
/me uses !quote !quote