Adding Chartool .rptok to Maptool fails

Discussion of your thoughts & requests, help for users and game specific configuration files for Character Tool

Moderators: dorpond, Azhrei

Post Reply
Rakeleer
Kobold
Posts: 3
Joined: Sun Oct 04, 2009 4:41 pm

Adding Chartool .rptok to Maptool fails

Post by Rakeleer »

Am I doing something wrong, or is this a bug?

I can add tokens to Maptool by "Adding resource library" to point to the directory containing tokens and then dragging the token into the map, but using Chartool 1.0.b12 (the only version that seemed to work out of the box for me) when I save the character, and try to add it as a token in Maptool (any of the versions I have tried in 1.3 series) I get:

Code: Select all

java.lang.InstantiationError: java.util.Map$Entry
	at sun.reflect.GeneratedSerializationConstructorAccessor1955.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at com.thoughtworks.xstream.converters.reflection.Sun14ReflectionProvider.newInstance(Sun14ReflectionProvider.java:62)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:257)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:124)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:195)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:125)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
	at com.thoughtworks.xstream.annotations.AnnotationReflectionConverter.unmarshallField(AnnotationReflectionConverter.java:66)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:188)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:125)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:117)
	at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(ReferenceByXPathMarshallingStrategy.java:29)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:846)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:833)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:789)
	at net.rptools.lib.io.PackedFile.getContent(PackedFile.java:138)
	at net.rptools.lib.io.PackedFile.getContent(PackedFile.java:123)
	at net.rptools.maptool.util.PersistenceUtil.loadToken(PersistenceUtil.java:411)
	at net.rptools.maptool.client.ui.assetpanel.ImageFileImagePanelModel.getTransferable(ImageFileImagePanelModel.java:98)
	at net.rptools.maptool.client.ui.assetpanel.AssetPanel$3.getTransferable(AssetPanel.java:261)
	at net.rptools.lib.swing.ImagePanel.dragGestureRecognized(ImagePanel.java:395)
	at java.awt.dnd.DragGestureRecognizer.fireDragGestureRecognized(Unknown Source)
	at sun.awt.windows.WMouseDragGestureRecognizer.mouseDragged(Unknown Source)
	at java.awt.AWTEventMulticaster.mouseDragged(Unknown Source)
	at java.awt.Component.processMouseMotionEvent(Unknown Source)
	at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(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.processMouseEvent(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.dispatchEvent(Unknown Source)
	at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:24)
	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)

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Adding Chartool .rptok to Maptool fails

Post by Azhrei »

Welcome to RPTools! ;)

You're seeing the error messages that result when MapTool tries to convert the XML that is stored inside the RPTOK file and there's some kind of error (the RPTOK is just a ZIP file with a different filename extension).

Unfortunately, the XStream library that takes care of the conversion doesn't provide enough information to narrow down exactly what the problem is (there's no line number from the XML file, for example). The version of CT that you're using is the latest (you stated you're using 1.0.b12 and that is the most recent); otherwise I would've guessed at an incompatibility between an older version of one program and a newer version of another.

Sorry, I can't help more than that. Perhaps if you post again and attach your RPTOK file to the posting, someone here can take a look at see what the problem is?

Background information would be good, too: which OS, which version of Java, how much memory for MapTool, which version of MapTool, and so on.

Rakeleer
Kobold
Posts: 3
Joined: Sun Oct 04, 2009 4:41 pm

Re: Adding Chartool .rptok to Maptool fails

Post by Rakeleer »

I'm using the latest version of both Chartool and Maptool, but have tried the last "stable 1.2 version of Maptool (which did not seem to see the Chartool rptok), and other, older version of maptool with the same results.

OS: Vista Pro, x32
Java: >java -version
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) Client VM (build 14.1-b02, mixed mode, sharing)
Maptool: With both the default batch and the .exe "launcher" memory defaults, also tried increasing to 512mb.
Version: 1.3.b56
Chartool:
Version 1.0.b12
Attachments
bob.rptok
Chartool rptok
(165.86 KiB) Downloaded 171 times

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Adding Chartool .rptok to Maptool fails

Post by Azhrei »

Jay, would you take a look at the RPTOK? It has this in it:

Code: Select all

  <propertyMap class="net.rptools.CaseInsensitiveHashMap">
    <store>
      <entry>
        <string>elevation</string>
        <net.rptools.CaseInsensitiveHashMap_-KeyValue>0</net.rptools.CaseInsensitiveHashMap_-KeyValue>
        <net.rptools.CaseInsensitiveHashMap_-KeyValue>
          <key>Elevation</key>
          <value class="string">0</value>
          <outer-class reference="../../../.."/>
        </net.rptools.CaseInsensitiveHashMap_-KeyValue>
        <net.rptools.CaseInsensitiveHashMap_-KeyValue>
          <key>Elevation</key>
          <value class="string">0</value>
          <outer-class reference="../../../.."/>
        </net.rptools.CaseInsensitiveHashMap_-KeyValue>
      </entry>
    </store>
And It appears that the <store> element shouldn't be there. The <entry> elements that follow it look fine. (You'll see what I mean if you check the file. :))

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Re: Adding Chartool .rptok to Maptool fails

Post by jay »

I tried out the token in the latest version of MT but it had the same problems. Looking at the file it appears to be a bug in the CT code that I've already fixed. When I loaded bob in to CT and re-saved it with my latest version of the code dropping the rptok on MT worked. I'm testing everything now for a drop tonight or tomorrow.

@Azhrei
The store is a HashMap within the CaseInsensitiveHashMap class used to store the values. The problem is that the first entry is within the store, but the rest of them are not.

Code: Select all

<propertyMap class="net.rptools.CaseInsensitiveHashMap">
  <store>
    <!-- Correct -->
    <entry>
       <!-- data here -->
       ...
    </entry>
  </store>
  <!-- Error is here -->
  <entry>
     <!-- data here -->
     ...
  </entry>
  ...

Rakeleer
Kobold
Posts: 3
Joined: Sun Oct 04, 2009 4:41 pm

Re: Adding Chartool .rptok to Maptool fails

Post by Rakeleer »

Hurray!

I'm mostly excited that it wasn't just me, doing something inane. :)

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Adding Chartool .rptok to Maptool fails

Post by Azhrei »

jay wrote:@Azhrei
The store is a HashMap within the CaseInsensitiveHashMap class used to store the values. The problem is that the first entry is within the store, but the rest of them are not.
Cool, glad you know about it. :)

I don't recall seeing the <store> element when I was doing a lot of work with macro definitions (which also use a hash) but maybe I'm just braindead. Turning 40 makes me an old man and these kinds of mistakes become more common. And that was 6 years ago... :mrgreen:

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Re: Adding Chartool .rptok to Maptool fails

Post by jay »

Azhrei wrote:I don't recall seeing the <store> element when I was doing a lot of work with macro definitions (which also use a hash) but maybe I'm just braindead.
I think it changed when the property names became case insensitive.
Azhrei wrote:Turning 40 makes me an old man and these kinds of mistakes become more common. And that was 6 years ago... :mrgreen:
Heh, me too, :)

jyanta
Kobold
Posts: 2
Joined: Wed Sep 22, 2010 1:29 pm

Re: Adding Chartool .rptok to Maptool fails

Post by jyanta »

I am having the same issue. I created a Character Using the Chartool version 1.0.b13. I created a new character using the Current Game D&D 4e -v3 with Player's Handbook 2 -v1 and Veggiesama's Campaign File Framework -v2 selected.

This created my .rptok file which I put into my MapTool version 1.3.b74 using the Veggiesama's campaign framework.

I get this error:

Code: Select all

java.lang.NullPointerException
	at net.rptools.maptool.util.PersistenceUtil.loadAssets(PersistenceUtil.java:481)
	at net.rptools.maptool.util.PersistenceUtil.loadToken(PersistenceUtil.java:464)
	at net.rptools.maptool.client.ui.assetpanel.ImageFileImagePanelModel.getTransferable(ImageFileImagePanelModel.java:101)
	at net.rptools.maptool.client.ui.assetpanel.AssetPanel$4.getTransferable(AssetPanel.java:277)
	at net.rptools.lib.swing.ImagePanel.dragGestureRecognized(ImagePanel.java:398)
	at java.awt.dnd.DragGestureRecognizer.fireDragGestureRecognized(Unknown Source)
	at sun.awt.windows.WMouseDragGestureRecognizer.mouseDragged(Unknown Source)
	at java.awt.AWTEventMulticaster.mouseDragged(Unknown Source)
	at java.awt.Component.processMouseMotionEvent(Unknown Source)
	at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(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.processMouseEvent(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.dispatchEvent(Unknown Source)
	at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:24)
	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)

I have looked at the xml and I do not see any issue with it but it will not load. I also have a lot of monsters that were created but they also do not work. Is there something wrong with the file or something wrong with my version of the map tool?

(My rptok file is included)
Attachments
Grimor.rptok
(45.31 KiB) Downloaded 159 times

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Adding Chartool .rptok to Maptool fails

Post by Azhrei »

Congratulations! You've found a bug!

8)

The CharTool file that you're importing is older than the rptok files that MT generates. The bug is that the code used by MT did not take into account the older CT file format. This is fixed in b75 (and the fix is available in SVN for those playing with the MT source code).

Post Reply

Return to “CharacterTool”