Execution Exception when attempting GroupRotate

Hello all,

When attempting to use group rotation in the Fantasy Battles module (http://fightingchaos.com/vassal/battle/index.html) I get the following:

21 May 2009 18:39:37.484 0 -- Starting
21 May 2009 18:39:37.484 0 -- OS Windows XP
21 May 2009 18:39:37.484 0 -- Java version 1.6.0_10-rc
21 May 2009 18:39:37.484 0 -- VASSAL version 3.1.5
21 May 2009 18:39:37.515 0 -- Manager
21 May 2009 18:39:40.781 0 -- Loading module file C:\Documents and Settings\bancliffe\My Documents\Vassal\fb_src_and_bin_04\doc\fantasy_battle.mod
21 May 2009 18:39:40.781 0 -- Loading module Fantasy Battle
21 May 2009 18:39:40.796 0 C:\Program Files\Java\jre6\bin\java -Xms256M -Xmx512M -DVASSAL.id=1 -cp lib\Vengine.jar;Vengine.jar VASSAL.launch.Player
21 May 2009 18:39:43.171 1 -- Fantasy Battle version 0.4
21 May 2009 18:39:43.171 1 

21 May 2009 18:40:19.250 1 java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: VASSAL/tools/ImageUtils
	at VASSAL.tools.opcache.OpCache.getFuture(OpCache.java:316)
	at VASSAL.tools.opcache.OpCache.get(OpCache.java:254)
	at VASSAL.tools.opcache.AbstractOpImpl.get(AbstractOpImpl.java:79)
	at VASSAL.tools.imageop.AbstractOpImpl.getImage(AbstractOpImpl.java:98)
	at VASSAL.tools.imageop.AbstractOpImpl.getImage(AbstractOpImpl.java:78)
	at VASSAL.tools.imageop.ScaledImagePainter.draw(ScaledImagePainter.java:49)
	at com.fightingchaos.VASSAL.counters.GroupRotator.draw(GroupRotator.java:392)
	at VASSAL.counters.Translate.draw(Translate.java:266)
	at VASSAL.counters.Translate.draw(Translate.java:266)
	at VASSAL.counters.Translate.draw(Translate.java:266)
	at VASSAL.counters.Translate.draw(Translate.java:266)
	at VASSAL.counters.Translate.draw(Translate.java:266)
	at VASSAL.counters.Translate.draw(Translate.java:266)
	at VASSAL.counters.SubMenu.draw(SubMenu.java:115)
	at VASSAL.counters.PropertySheet.draw(PropertySheet.java:181)
	at VASSAL.counters.Pivot.draw(Pivot.java:198)
	at VASSAL.counters.Pivot.draw(Pivot.java:198)
	at VASSAL.counters.Pivot.draw(Pivot.java:198)
	at VASSAL.build.module.map.StackMetrics.draw(StackMetrics.java:350)
	at com.fightingchaos.VASSAL.build.module.GroupingMap.drawPiecesInRegion(GroupingMap.java:47)
	at VASSAL.build.module.Map.paintRegion(Map.java:1435)
	at VASSAL.build.module.Map.paintRegion(Map.java:1428)
	at VASSAL.build.module.Map$View.paint(Map.java:2526)
	at javax.swing.JComponent.paintToOffscreen(Unknown Source)
	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
	at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
	at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
	at javax.swing.RepaintManager.paint(Unknown Source)
	at javax.swing.JComponent._paintImmediately(Unknown Source)
	at javax.swing.JComponent.paintImmediately(Unknown Source)
	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
	at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
	at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	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)
Caused by: java.lang.NoClassDefFoundError: VASSAL/tools/ImageUtils
	at com.fightingchaos.VASSAL.counters.GroupRotator$LabelOp.buildDimensions(GroupRotator.java:200)
	at com.fightingchaos.VASSAL.counters.GroupRotator$LabelOp.eval(GroupRotator.java:145)
	at VASSAL.tools.imageop.AbstractOpImpl.eval(AbstractOpImpl.java:54)
	at VASSAL.tools.opcache.OpCache.getFuture(OpCache.java:311)
	... 41 more
Caused by: java.lang.ClassNotFoundException: Unable to load class VASSAL.tools.ImageUtils
	at VASSAL.tools.DataArchive.findClass(DataArchive.java:373)
	at VASSAL.tools.DataArchive.loadClass(DataArchive.java:346)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	... 45 more
Caused by: java.io.FileNotFoundException: 'VASSAL/tools/ImageUtils.class' not found in C:\Documents and Settings\bancliffe\My Documents\Vassal\fb_src_and_bin_04\doc\fantasy_battle.mod
	at VASSAL.tools.DataArchive.getInputStream(DataArchive.java:194)
	at VASSAL.tools.DataArchive.findClass(DataArchive.java:368)
	... 48 more

This occurs on the second click of the process. Any idea? I’d like to get this working so that I can implement it in my own module. Any help would be appreciated!

Squizm

Looks like a problem in some custom code. It seems that there are
some things missing that perhaps were present in an earlier release of
Vassal? I wonder if it would work in 2.99 or 3.0?

On May 21, 2009, at 11:50 AM, squizm wrote:


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “squizm”:

The problem is that this moudle is using the old package name for ImageUtils.
It used to be VASSAL.tools.ImageUtils, but for some time now it’s been
VASSAL.tools.image.ImageUtils instead.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thanks for the heads up about the class structure change. I’ve modified and rebuilt the classes to correct the import statements. However, now when I attempt to import the group rotator class I receive the following:

java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at VASSAL.counters.PieceDefiner.importPiece(PieceDefiner.java:518) at VASSAL.counters.PieceDefiner$3.actionPerformed(PieceDefiner.java:277) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(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 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) Caused by: java.lang.NullPointerException at fightingchaos.VASSAL.counters.GroupRotator.init(GroupRotator.java:244) at fightingchaos.VASSAL.counters.GroupRotator.<init>(GroupRotator.java:260) at fightingchaos.VASSAL.counters.GroupRotator.<init>(GroupRotator.java:253) ... 31 more

Thanks again!

Thus spake “squizm”:

This is the relevant part for the problem you’re seeing now:

GroupRotator is custom code in your module, it’s not ours.

J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

This was at the top of java file:

[code] * $Id: FreeRotator.java 3572 2008-05-07 15:29:07Z uckelman $
*

  • Copyright (c) 2000-2003 by Rodney Kinney[/code]

So I thought this would be the right place to bring it up. I have not modified the code in any way except to update the import call.

On May 22, 2009, at 11:27 AM, squizm wrote:

But the ID field refers to a file called FreeRotator.java and the
problem is with a class called GroupRotator.

So what I suspect is that someone else took the FreeRotator code that
Joel wrote and modified it to create GroupRotator, but without adding
it to their own source control system and also without changing the
source control ID comment or other copyright information.

So, even though it might appear that this was written by Joel or
Rodney, in fact it was (probably) modified by someone else taking
their code for FreeRotator as a starting point. And the modification
seems to have a bug in it.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Thomas Russ:

I concur. It looks like GroupRotator might have been based on FreeRotator,
but whoever did the modifications didn’t change the $Id$ attribute (which
is automatically generated by Subversion). Whoever made the changes should
have added their own name to the copyright info, as well.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

fixed to be 3.1.5 compliant