Error while dropping asset on map

Developer discussion regarding MapTool 1.4

Moderators: dorpond, trevor, Azhrei

Forum rules
Posting now open to all registered forum users.
Post Reply
xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Error while dropping asset on map

Post 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.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Error while dropping asset on map

Post 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

bobifle
Giant
Posts: 219
Joined: Thu Oct 19, 2017 12:36 pm

Re: Error while dropping asset on map

Post 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.

xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Re: Error while dropping asset on map

Post 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.

Post Reply

Return to “MapTool 1.4”