java.lang.NoClassDefFoundError

The RPTools applications are written in Java. If you're interested in contributing to any project here by submitting patches to the source code, this is the forum to ask questions about how to do so. Please put the two-letter tool name abbreviation in your thread Title. To enter this group, go to the Usergroups page of your User Control Panel and join the Java Developer group.

Moderators: dorpond, trevor, Azhrei

Post Reply
MetaGamer
Kobold
Posts: 15
Joined: Sat Jun 26, 2010 3:39 am

java.lang.NoClassDefFoundError

Post by MetaGamer »

Ok, I'm about ready to pull out my hair. I made a copy of the class ZoneRenderer, then I deleted it. (don't ask...) Not sure if that was the trigger, but it seems like the last thing I did. Now when I launch MapTool, I get:
java.lang.NoClassDefFoundError: net/rptools/maptool/client/ui/zone/ZoneRenderer$ItemRenderer
at net.rptools.maptool.client.ui.zone.ZoneRendererFactory.newRenderer(ZoneRendererFactory.java:24)
at net.rptools.maptool.client.MapTool.setCampaign(MapTool.java:647)
at net.rptools.maptool.client.MapTool.setCampaign(MapTool.java:627)
at net.rptools.maptool.client.ClientMethodHandler$1.run(ClientMethodHandler.java:192)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:24)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.ClassNotFoundException: net.rptools.maptool.client.ui.zone.ZoneRenderer$ItemRenderer
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 13 more
ZoneRenderFactory isn't touched. Nothing in ZoneRenderer is changed that affects ItemRenderer.

I've restarted Eclipse, "refresh"ed, made sure the .classpath file isn't changed... I dunno what's going on. Any help?

MetaGamer
Kobold
Posts: 15
Joined: Sat Jun 26, 2010 3:39 am

Re: java.lang.NoClassDefFoundError - nevermind

Post by MetaGamer »

I exited Eclipse, changed ZoneRenderer in some trivial way, and now it works.
Gremlins.

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

Re: java.lang.NoClassDefFoundError

Post by Azhrei »

There are times when the leftovers from a previous build (Eclipse normally has auto-build turned on for projects) can cause a problem for an app as complex as MapTool that uses ANT to build files that are then put into the output directories. :?

I've found that using the Clean... option on the Project menu is necessary after I put out a new build. Otherwise the version.txt file (which is generated dynamically) is still there and MapTool thinks it's a build version instead of a development version.

Post Reply

Return to “Java Programming Info”