JDK-6180249 : DataTransfer of animated GIF through system clipboard throws IOException on XToolkit (inter-JVM)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2004-10-16
  • Updated: 2011-01-19
  • Resolved: 2007-02-03
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
I am copying an animated GIF image to the system clipboard on one JVM and trying to retrieve it from another application running on a different JVM. But as soon as I call clipboard.getData(), the app freezes for a min and throws an IOException on solaris/linux with XToolkit. This works fine on the same JVM.

This exception causes the source application to freeze (app that copied the image to the clipboard). For image flavors, there is an issue with the supported flavors (a bug filed on this: 6180247) but that has been eliminated in this test by making sure that the flavor passed is a java image flavor. But still the exception is thrown.

Here is the exception: 
java.io.IOException: Owner failed to convert data
at sun.awt.X11.XSelection.getData(XSelection.java:316)
at sun.awt.X11.XClipboard.getClipboardData(XClipboard.java:98)
at sun.awt.datatransfer.SunClipboard.getData(SunClipboard.java:211)
at ImageTransferTest.actionPerformed(ImageTransferTest.java:65)
at java.awt.Button.processActionEvent(Button.java:388)
at java.awt.Button.processEvent(Button.java:356)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

This is reproducible on Tiger as well as Mustang on XToolkit. On Motif, it just hangs. This is not reproducible for same JVM case. Occurs only when calling getData() from a diff JVM.

I have attached the sample test. Execute the sample text on 2 JVMs separately as follows:
java ImageTransferTest cupanim.gif
Click 'Copy' on one app and 'Paste' on another, both running on diff JVMs. If you see the above exception on Linux/solaris, the bug is reproduced.
###@###.### 10/16/04 16:05 GMT

Comments
EVALUATION The JVM that provides data hangs because of the same issue as 4088017 (Animated GIF as Frame's icon image hangs java): sun.awt.image.ImageRepresentation.reconstruct(ImageObserver.ALLBITS) hangs if the corresponging image is multiframe. The JVM that retrieves data waits indefinitely on MToolit, it waits for a while on XToolkit and then throws the exception as it couldn't retrieve the requested data. The bug related to the hang on retrieval of clipboard data is 4818143 (NetBeans Hungs on sun.awt.datatransfer.ClipboardTransferable.getClipboardData). ###@###.### 10/18/04 09:12 GMT
18-10-2004