JDK-6578041 : Drag & Drop from Motif to Java does not work.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u12,7
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux,linux_redhat_5.0
  • CPU: x86
  • Submitted: 2007-07-09
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u13-crevFixed 7 b123Fixed
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b14)
Java HotSpot(TM) Client VM (build 1.7.0-ea-b14, mixed mode, sharing)

java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)


ADDITIONAL OS VERSION INFORMATION :
Linux xxx 2.6.18-8.1.6.el5 #1 SMP Fri Jun 1 18:52:11 EDT 2007 i686 i686 i386 GNU/Linux
Red Hat Enterprise Linux 5


EXTRA RELEVANT SYSTEM CONFIGURATION :
X Window System Version 7.1.1, xorg-x11-server 1.1.1-48.13.0.1.el5



A DESCRIPTION OF THE PROBLEM :
A Drag & Drop from a Motif application to a Java application does not work.
If you use the java program locally the drag image remains some seconds on the drop target and then snaps back to the drag source.

If the Java application is started on a remote computer and displays on the local computer the X Windows system cannot be used anymore after issueing a drag & drop from a Motif application to the a java application.  The X Server must be killed.

This behavior is completely reproducible on a RHEL 5 system.
On RHEL4  and SuSe 10.2 it is not reproducible but happens from time to time. On RHEL 4 and SuSe 10.2 only a reboot solves the problem if it appears. All these systems have a Xorg XServers. On RHEL 3 the problem does not appear (this has a XFree XServer).


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Start the SwingSet2 Demo on a RHEL 5 system.
2. Choose a drag source (e.g. JoptionPane Demo, Show Input Dialog, the text input line is a drop target
3. Start a motif program and choose a drag source(e.g. ddd, Choose File > Open Program, select text in the filter )
4. Drag something from the Motif program to the Java drop source (e.g. the selected text in ddd to the text input line in the SwingSet2 demo).

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Drag & Drop work and the X server does not freeze.
ACTUAL -
Drag & Drop does not work.
Using it remotely the X server freezes.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Some java programs display the following exception (but not the SwingSet2 demo):
java.io.IOException: Owner timed out
        at sun.awt.X11.XSelection.getData(Unknown Source)
        at sun.awt.X11.MotifDnDDropTargetProtocol.getData(Unknown Source)
        at sun.awt.X11.XDropTargetContextPeer.getNativeData(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 de.bruker.mri.infra.beans.dnd.DatasetDnDDelegate.HandleString(DatasetDnDDelegate.java:241)
        at de.bruker.mri.infra.beans.dnd.DatasetDnDDelegate.ImportData(DatasetDnDDelegate.java:133)
        at de.bruker.mri.jive.tasks.read.ReadDataSelectionPanel$DatasetLabel$MyTransferHandler.importData(ReadDataSelectionPanel.java:162)
        at javax.swing.TransferHandler$DropHandler.drop(Unknown Source)
        at java.awt.dnd.DropTarget.drop(Unknown Source)
        at javax.swing.TransferHandler$SwingDropTarget.drop(Unknown Source)
        at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(Unknown Source)
        at sun.awt.X11.XDropTargetContextPeer.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.Window.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.

CUSTOMER SUBMITTED WORKAROUND :
use java -Dawt.toolkit=sun.awt.motif.MToolkit to start the application.

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/build/jdk/rev/786f42385034
25-12-2010

SUGGESTED FIX http://jpsesvr.sfbay.sun.com:8080/ctetools/CodeStore/3839/webrev/index.html
04-12-2010

EVALUATION when MotifDnDConstants.Swapper.getInt() is called from sun.awt.X11.MotifDnDDropTargetProtocol.getData() to read a timestamp, a value (32-bit unsigned int) is initially assigned to 32-bit signed int var. Hence, values that exceed (2^31)-1 are interpreted as negative.
21-07-2010

EVALUATION This problem may be related to issue found in CR6860491 for Solaris source. My need to check Linux64_x86 source tree.
13-07-2010

EVALUATION As I know ddd currently uses LessTif free motif clone. On my Gentoo host DDD even could not start drag operation =( I tried to reproduce the problem on CDE (of course it is not the same enviroment) the applications worked fine.
10-07-2007