RPTools.net

Discussion and Support

Skip to content

It is currently Fri Jul 21, 2017 7:44 pm 






Reply to topic  [ 10 posts ] 

Previous topic | Next topic 

  Print view

Author Message
 Offline
Kobold
 
Joined: Sun Oct 04, 2009 3:41 pm
Posts: 3
 Post subject: Adding Chartool .rptok to Maptool fails
PostPosted: Sun Oct 04, 2009 3:44 pm 
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:
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)


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12070
Location: Tampa, FL
 Post subject: Re: Adding Chartool .rptok to Maptool fails
PostPosted: Sun Oct 04, 2009 5:22 pm 
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.


Top
 Profile  
 
 Offline
Kobold
 
Joined: Sun Oct 04, 2009 3:41 pm
Posts: 3
 Post subject: Re: Adding Chartool .rptok to Maptool fails
PostPosted: Sun Oct 04, 2009 5:41 pm 
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


File comment: Chartool rptok
bob.rptok [165.86 KiB]
Downloaded 124 times
Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12070
Location: Tampa, FL
 Post subject: Re: Adding Chartool .rptok to Maptool fails
PostPosted: Sun Oct 04, 2009 6:53 pm 
Jay, would you take a look at the RPTOK? It has this in it:

Code:
  <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. :))


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1766
Location: Austin, Tx
 Post subject: Re: Adding Chartool .rptok to Maptool fails
PostPosted: Mon Oct 05, 2009 1:25 pm 
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:
<propertyMap class="net.rptools.CaseInsensitiveHashMap">
  <store>
    <!-- Correct -->
    <entry>
       <!-- data here -->
       ...
    </entry>
  </store>
  <!-- Error is here -->
  <entry>
     <!-- data here -->
     ...
  </entry>
  ...


Top
 Profile  
 
 Offline
Kobold
 
Joined: Sun Oct 04, 2009 3:41 pm
Posts: 3
 Post subject: Re: Adding Chartool .rptok to Maptool fails
PostPosted: Mon Oct 05, 2009 2:27 pm 
Hurray!

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


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12070
Location: Tampa, FL
 Post subject: Re: Adding Chartool .rptok to Maptool fails
PostPosted: Mon Oct 05, 2009 11:45 pm 
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:


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1766
Location: Austin, Tx
 Post subject: Re: Adding Chartool .rptok to Maptool fails
PostPosted: Tue Oct 06, 2009 9:30 am 
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, :)


Top
 Profile  
 
 Offline
Kobold
 
Joined: Wed Sep 22, 2010 12:29 pm
Posts: 2
 Post subject: Re: Adding Chartool .rptok to Maptool fails
PostPosted: Wed Sep 22, 2010 1:24 pm 
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:
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)


Grimor.rptok [45.31 KiB]
Downloaded 121 times
Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12070
Location: Tampa, FL
 Post subject: Re: Adding Chartool .rptok to Maptool fails
PostPosted: Thu Sep 23, 2010 12:18 am 
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).


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 10 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman