FAQ: Why do I get an exception when running MIPAV via X11 forwarding on Linux?

From MIPAV
Revision as of 16:37, 22 May 2013 by Mccreedy (Talk | contribs)

(diff) <previousrevision> | Latest revision (diff) | <nextrevision> (diff)
Jump to: navigation, search

Question:

When I try to run MIPAV via X11 forwarding on a remote Linux system, I get the exception below when opening some dialogs.

Exception in thread "AWT-EventQueue-0" 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:6687)
       at java.awt.Container.addNotify(Container.java:2567)
       at javax.swing.JComponent.addNotify(JComponent.java:4685)
[..snip..]

Answer:

This exception is due to an incompatibility between Java and the X11 forwarding client. Adding "-DsuppressSwingDropSupport=true" (without the quotes) to the VM arguments circumvents the problem. To add this to MIPAV's startup, go to the installation directory of MIPAV on the remote computer and open the file mipav.lax in your favorite editor.

Find the section that looks like:

#   LAX.NL.JAVA.OPTION.ADDITIONAL
#   -----------------------------
#   Runtime server switch to force java to run as:
#   java -server MipavMain  etc, etc, etc

lax.nl.java.option.additional=-server

And change it to:

#   LAX.NL.JAVA.OPTION.ADDITIONAL
#   -----------------------------
#   Runtime server switch to force java to run as:
#   java -server MipavMain  etc, etc, etc

lax.nl.java.option.additional=-server -DsuppressSwingDropSupport=true

The next time you run MIPAV, you should not encounter the same issue.