Ruben Laguna's blog

Mar 2, 2009 - 2 minute read - deserializing java netbeans NoClassDefFoundError tcid topcomponent

Netbeans: "Problem when deserializing TopComponent for tcID"

Today I experienced a strange problem. Or I thought it was strange . I just checkout a my project from Subversion into Netbeans and it didn’t work!. How come? I have another working copy that works just ok. So I check the logs in $app/build/testuserdir/var/log/messages.log and I found

INFO [org.netbeans.core.windows.persistence]: [PersistenceManager.getTopComponentForID] Problem when deserializing TopComponent for tcID:'XBeeTopComponent'. Reason: com/rapplogic/xbee/api/XBeeException
java.lang.NoClassDefFoundError: com/rapplogic/xbee/api/XBeeException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
at java.lang.Class.getMethod0(Class.java:2642)
at java.lang.Class.getMethod(Class.java:1579)
at org.netbeans.modules.settings.convertors.XMLSettingsSupport$SettingsRecognizer.createFromMethod(XMLSettingsSupport.java:664)
at org.netbeans.modules.settings.convertors.XMLSettingsSupport$SettingsRecognizer.instanceCreate(XMLSettingsSupport.java:581)
at org.netbeans.modules.settings.convertors.SerialDataConvertor$SettingsInstance.instanceCreate(SerialDataConvertor.java:420)
[catch] at org.netbeans.core.windows.persistence.PersistenceManager.getTopComponentPersistentForID(PersistenceManager.java:531)
at org.netbeans.core.windows.persistence.PersistenceManager.getTopComponentForID(PersistenceManager.java:641)
at org.netbeans.core.windows.PersistenceHandler.getTopComponentForID(PersistenceHandler.java:422)
at org.netbeans.core.windows.PersistenceHandler.load(PersistenceHandler.java:162)
at org.netbeans.core.windows.WindowSystemImpl.load(WindowSystemImpl.java:69)
at org.netbeans.core.NonGui$2.run(NonGui.java:178)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

NoClassDefDFoundError. ok. It was working before but I can take look. Guess what I changed the name of the jar that contains that class, long time ago but it didn’t show up until now when I started from a clean directory. I found that in the Library Wrapper Module project..xml still contains the old name

<class-path-extension>
<runtime-relative-path>ext/xbee-api.jar</runtime-relative-path>
<binary-origin>release/modules/ext/xbee-api-0.5.1.jar</binary-origin>
</class-path-extension>

that runtime-relative-path should be xbee-api-0.5.1.jar.

I changed to the proper filename and it worked. I can’t remember if I edited project.xml by hand before and that’s why I got it “corrupted” or if I managed to “leave” the file in a inconsistent state by using some wizard but I’m glad to have found it out so quickly.

Note to myself: create a new working directory regularly so I find out this kind of issues.