JDK-6942478 : java.security.AccessControlException while calling getTransferData from Applet
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u19
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2010-04-09
  • Updated: 2011-02-16
  • Resolved: 2010-05-06
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_19"
Java(TM) SE Runtime Environment (build 1.6.0_19-b04)
Java HotSpot(TM) Client VM (build 16.2-b04, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.0.6002]


A DESCRIPTION OF THE PROBLEM :
Our applet worked fine with Java 1.6.0_17.
When dragging a word and dropping it into a text area registered as a drop target, get get a security exception, apparently when trying to read from clipboard.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Sorry, it's clunky.  I'll try to make a better test case, but...
1.  Open http://epgyschools.stanford.edu/LAWCourseBrowser.php?version=10 in a browser,
2.  On the second pulldown menu on the top (starts at "Sentence Structure"), select "Paragraphs",
3.  Wait until the main body of the applet redraws,
3.  On the rightmost pulldown menu at the top, select "4. Detail Sentences in Paragraphs", and
4.  Drag the sentence "I want to take a train across the country" from the green rectangle into the blue shaded space in the red rectangle, between the phrases "would be free." and "In the Civil War".

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The dropped text replaces the blue box, making a complete paragraph
ACTUAL -
the dropped text does not appear in the text area.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (java.awt.AWTPermission accessClipboard)
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at java.security.AccessController.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkSystemClipboardAccess(Unknown Source)
	at sun.awt.dnd.SunDropTargetContextPeer.getTransferData(Unknown Source)
	at sun.awt.datatransfer.TransferableProxy.getTransferData(Unknown Source)
	at java.awt.dnd.DropTargetContext$TransferableProxy.getTransferData(Unknown Source)
	at author.widgets.SentenceDraggerTarget$DTListener.drop(SentenceDraggerTarget.java:304)
	at java.awt.dnd.DropTarget.drop(Unknown Source)
	at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(Unknown Source)
	at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEvent(Unknown Source)
	at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(Unknown Source)
	at sun.awt.dnd.SunDropTargetEvent.dispatch(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processDropTargetEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
java.lang.NullPointerException
	at author.widgets.SentenceDraggerTarget$DTListener.drop(SentenceDraggerTarget.java:309)
	at java.awt.dnd.DropTarget.drop(Unknown Source)
	at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(Unknown Source)
	at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEvent(Unknown Source)
	at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(Unknown Source)
	at sun.awt.dnd.SunDropTargetEvent.dispatch(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processDropTargetEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
/* Working on it.  I can provide the relevant class code but not the DnD infrastructure glue. */
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
We are rewriting our application not to use Transferable for now.  The DnD features were nice, but we can write them ourselves, probably.

Release Regression From : 6u17
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

Comments
EVALUATION This may be related to the recent DnD fixes on the AWT side
05-05-2010