Page 1 of 1

Error while dropping asset on map

Posted: Fri Dec 15, 2017 4:14 pm
by xavram
I was chugging along on my map without any problems and then I got this error when i dropped an image on the map. I'm in 1.4.1.7

java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeLo(Unknown Source)
at java.util.TimSort.mergeAt(Unknown Source)
at java.util.TimSort.mergeCollapse(Unknown Source)
at java.util.TimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.List.sort(Unknown Source)
at java.util.Collections.sort(Unknown Source)
at net.rptools.maptool.model.Zone.putToken(Zone.java:1114)
at net.rptools.maptool.client.ui.zone.ZoneRenderer.addTokens(ZoneRenderer.java:3888)
at net.rptools.maptool.client.ui.zone.ZoneRenderer.drop(ZoneRenderer.java:3954)
at javax.swing.TransferHandler$SwingDropTarget.drop(Unknown Source)
at sun.awt.dnd.SunDropTargetContextPeer.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.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:36)
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)

Now, any time I drop ANY image on the map, I get this error...or if I move an image (not just the one I just dropped)...

Help! This is a large map that I've taken a lot of time with, I will be sick to my stomach if I have to start over!

Switched to another map in the campaign and it doesn't have this behavior, so it seems to be something with this particular map.

Re: Error while dropping asset on map

Posted: Fri Dec 15, 2017 6:56 pm
by Jagged
My guess would be an issue with the image you dropped. Looking at the stack trace I suspect it hasn't got an asset id and that is corrupting the ZOrder comparison.

How good are you at running Maptool from java without using the launcher?

If you can call java with the legacy sort parameter, it might work and allow you to delete the problematic image.

Something like:
javaw -Djava.util.Arrays.useLegacyMergeSort=true -Xss6M -Xmx1024M -jar Maptool-1.4.1.2-fat.jar run
I'm not promising though :o

Re: Error while dropping asset on map

Posted: Mon Dec 18, 2017 6:47 am
by bobifle
In case Jagged's method does not work for you, there's an alternative method to remove an offending token.

You need to unzip you campaign file, edit the content.xml file, remove the <entry> node corresponding to your token, and rezip everything.

Re: Error while dropping asset on map

Posted: Mon Dec 18, 2017 10:28 am
by xavram
What I actually did was duplicate the map, then deleted the original. For whatever reason, that seemed to do the trick, as I no longer get the error and I can add/move assets without issue.