JDK-7027598 : Exception thrown when using JTextField when not using drag and drop
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u24
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: linux
  • CPU: x86
  • Submitted: 2011-03-15
  • Updated: 2014-03-06
  • Resolved: 2011-08-18
Related Reports
Relates :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Server VM (build 19.1-b02, mixed mode)

We also find this issue on 1.6.0_23 but not on 1.6.0_20 or earlier

ADDITIONAL OS VERSION INFORMATION :
Linux PROG0334.ikonscience.local 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux


EXTRA RELEVANT SYSTEM CONFIGURATION :
This is happening on all our linux systems, 32bit, 64bit, Enterprise Linux 5 and 6

A DESCRIPTION OF THE PROBLEM :
When adding a component to a dialog we get the following exception more often than not.
It seems to be a problem with JTextField in particular.



REGRESSION.  Last worked in version 6

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a Jdialog, add a Jtextfield to it.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
When opening the dialog no exception is thrown
ACTUAL -
Exception is thrown ~80% of the time

ERROR MESSAGES/STACK TRACES THAT OCCUR :
sun.awt.X11.XException: Cannot write XdndAware property
at sun.awt.X11.XDnDDropTargetProtocol.registerDropTarget(XDnDDropTargetProtocol.java:79)
at sun.awt.X11.XDropTargetRegistry.registerDropSite(XDropTargetRegistry.java:554)
at sun.awt.X11.XWindowPeer.addDropTarget(XWindowPeer.java:1633)
at sun.awt.X11.XComponentPeer.addDropTarget(XComponentPeer.java:1509)
at java.awt.dnd.DropTarget.addNotify(DropTarget.java:493)
at java.awt.Component.addNotify(Component.java:6688)
at java.awt.Container.addNotify(Container.java:2567)
at javax.swing.JComponent.addNotify(JComponent.java:4685)
at java.awt.Container.addNotify(Container.java:2578)
at javax.swing.JComponent.addNotify(JComponent.java:4685)
at java.awt.Container.addNotify(Container.java:2578)
at javax.swing.JComponent.addNotify(JComponent.java:4685)
at java.awt.Container.addNotify(Container.java:2578)
at javax.swing.JComponent.addNotify(JComponent.java:4685)
at java.awt.Container.addNotify(Container.java:2578)
at javax.swing.JComponent.addNotify(JComponent.java:4685)
at java.awt.Container.addNotify(Container.java:2578)
at javax.swing.JComponent.addNotify(JComponent.java:4685)
at java.awt.Container.addNotify(Container.java:2578)
at javax.swing.JComponent.addNotify(JComponent.java:4685)
at java.awt.Container.addImpl(Container.java:1068)
at java.awt.Container.add(Container.java:379)
at com.isl.core.data.DataDialog.showDialog(DataDialog.java:51)

REPRODUCIBILITY :
This bug can be reproduced often.

CUSTOMER SUBMITTED WORKAROUND :
Our work around is to set the "setDropTarget(null)" for every JTextField, JFormattedTextField and JSpinner in our project. However, there are hundreds of these and to do this would be impracticable. For now we have simply switched back to jdk 1.6.0_22. This is a real problem for us as it effectively means we can't release our software on Linux.

Comments
EVALUATION The CR was Incomplete over 1 month please re-open if you re-evaluated with new details
18-08-2011

EVALUATION Could not reproduce the issue with the attached test on Ubuntu 10.4. with jdk7, 6u25, 6u24, 6u23.
16-05-2011

WORK AROUND CUSTOMER SUBMITTED WORKAROUND : Our work around is to set the "setDropTarget(null)" for every JTextField, JFormattedTextField and JSpinner in our project. However, there are hundreds of these and to do this would be impracticable. For now we have simply switched back to jdk 1.6.0_22. This is a real problem for us as it effectively means we can't release our software on Linux.
16-05-2011

EVALUATION Please obtain more information. Which window manager is used (Metacity, mutter, kdm etc...). Could be example provided? Whether the swing code is invoked on EDT.
16-05-2011