views:

326

answers:

1

I am getting the following stack trace. Just want to know what your first impression is. Does it seem to be saying that Vectors cannot be saved to the Berkeley DB. What else can I provide you with, that will help work this out.

Exception in thread "Timer-0" java.lang.IllegalArgumentException: Class could not be loaded or is not persistent: java.util.Vector
    at com.sleepycat.persist.impl.PersistCatalog.createFormat(PersistCatalog.java:588)
    at com.sleepycat.persist.impl.FieldInfo.collectRelatedFormats(FieldInfo.java:131)
    at com.sleepycat.persist.impl.ComplexFormat.collectRelatedFormats(ComplexFormat.java:262)
    at com.sleepycat.persist.impl.PersistCatalog.createFormat(PersistCatalog.java:616)
    at com.sleepycat.persist.impl.PersistCatalog.addNewFormat(PersistCatalog.java:805)
    at com.sleepycat.persist.impl.PersistCatalog.getFormat(PersistCatalog.java:745)
    at com.sleepycat.persist.impl.PersistEntityBinding.getOrCreateFormat(PersistEntityBinding.java:176)
    at com.sleepycat.persist.impl.PersistEntityBinding.<init>(PersistEntityBinding.java:36)
    at com.sleepycat.persist.impl.Store.getPrimaryIndex(Store.java:328)
    at com.sleepycat.persist.EntityStore.getPrimaryIndex(EntityStore.java:257)
    at db.LastTopMovesDA.<init>(LastTopMovesDA.java:24)
    at dao.LastTopMove.saveLastTopMove(LastTopMove.java:59)
    at model.logic.MoveFilter.getTopMoves(MoveFilter.java:172)
    at controller.Poller$1.run(Poller.java:50)
    at java.util.TimerThread.mainLoop(Unknown Source)
    at java.util.TimerThread.run(Unknown Source)
+1  A: 

You probably need to serialize your data before passing them to Berkeley DB for storage.

ynimous
I am able to save a HashMap without serialization. Is there anything different between the two that means the Vector needs to serialized but not the HashMap
Ankur
Without knowing much about it, I would guess that because HashMap has allready a key-value structure, berkeley db handles its storage transparently, be serializing the key/value pairs and storing them in the database.you could take a look at the docs for more info(e.g <http://www.oracle.com/technology/documentation/berkeley-db/je/GettingStartedGuide/applicationoverview.html#storing-intro>)
ynimous