Closed gary-rowe closed 9 years ago
Also:
"@timestamp": "2015-06-29T15:19:36.781+10:00",
"level": "ERROR",
"thread_name": "AWT-EventQueue-0",
"logger_name": "org.multibit.hd.core.error_reporting.ExceptionHandler",
"message": "Uncaught exception",
"stack_trace": "java.lang.NullPointerException: Failed to retrieve atom name. at sun.awt.X11.XlibWrapper.XGetAtomName(Native Method) ~[na:1.8.0_45] at sun.awt.X11.XAtom.getName(XAtom.java:186) ~[na:1.8.0_45] at sun.awt.X11.XDataTransferer.getTargetNameForAtom(XDataTransferer.java:165) ~[na:1.8.0_45] at sun.awt.X11.XDataTransferer.getNativeForFormat(XDataTransferer.java:154) ~[na:1.8.0_45] at sun.awt.datatransfer.DataTransferer.getFlavorsForFormats(DataTransferer.java:736) ~[na:1.8.0_45] at sun.awt.datatransfer.ClipboardTransferable.
The earlier stacktrace is dealt with in #645 The second stack trace looks like a bug in the JVM for 1.4/ 1.5 on Linux. See: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6322854
Marked as awaiting issue since a probabilistic fix went into 0.1.2.
Still seeing these in 0.1.2 e.g:
New error report uploaded. Id: e372118
MultiBit HD version: 0.1.2 Operating system: 64 3.13.0-49-generic Linux
No user notes
Number of stack traces: 1
First stack trace:
java.lang.NullPointerException: Failed to retrieve atom name.
at sun.awt.X11.XlibWrapper.XGetAtomName(Native Method) ~[na:1.7.0_79]
at sun.awt.X11.XAtom.getName(XAtom.java:186) ~[na:1.7.0_79]
at sun.awt.X11.XDataTransferer.getTargetNameForAtom(XDataTransferer.java:166) ~[na:1.7.0_79]
at sun.awt.X11.XDataTransferer.getNativeForFormat(XDataTransferer.java:155) ~[na:1.7.0_79]
at sun.awt.datatransfer.DataTransferer.getFlavorsForFormats(DataTransferer.java:804) ~[na:1.7.0_79]
at sun.awt.datatransfer.ClipboardTransferable.
This looks like this JVM bug: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6322854
It is fixed in Java 1.6
It would be nice to prevent this happening, even if it means disabling functionality in older JVMs.
Not sure that it is fixed in Java 6 (or 7 for that matter). - it's still marked as unresolved.
We compile under Java 7 and use relevant language syntax so a Java 6 VM or earlier won't be able to compile the code and certainly can't access the byte code. Therefore we shouldn't need to detect early versions of Java running on Linux although we could possibly restrict < 1.7.0_80 (we do require 1.7.0_12+ via Install4j).
There's an interesting article covering it which suggests two approaches:
sun.awt.datatransfer.SunClipboard#addFlavorListener
$ killall clipit
$ xclipboard &
This StackOverflow article also sheds a bit more light on this from the Java perspective.
Just been reading those articles. I would imagine we call: sun.awt.datatransfer.SunClipboard#addFlavorListener indirectly at construction time of anything that has cut/ paste functionality where the user can type.
Seems a bit excessive to:
try { //blah} catch (NullPointerException npe) { // throw the NPE away}
for all text based UI constructors. There must be a better way.
This would be a good candidate for absorption by an improved ErrorReporter so marking as 'Awaiting issue' (#708)
From the error logs (Windows 8 64 bit):