Forum Stats

  • 3,768,739 Users
  • 2,252,843 Discussions
  • 7,874,705 Comments

Discussions

ClassNotFoundException when running DbVerify

mgrandi
mgrandi Member Posts: 18
edited Jun 1, 2016 11:42PM in Berkeley DB Java Edition

Running DbVerify results in a ClassNotFoundException when checking the "persist#Meta#com.sleepycat.persist.formats" database, but I don't know why its trying to load the class in the first place? The class does actually exist when the application that uses the BDB JE library is running, but it obviously doesn't exist when I'm just running the DbVerify utility from the jar. Is the database actually corrupted? Am i supposed to pass in classpath arguments to java when running DbVerify so it doesn't get the ClassNotFoundException?

java -cp ~/.m2/repository/com/sleepycat/je/6.4.25/je-6.4.25.jar com.sleepycat.je.util.DbVerify -h /Volumes/mgrandi_256SSD/data/bdb

..... blah blah ....

Verifying database persist#Meta#com.sleepycat.persist.formats

Checking tree for persist#Meta#com.sleepycat.persist.formats

BTree: Composition of btree, types and counts of nodes.

    binCount=1

    binEntriesHistogram=[0-9%: 1]

    binsByLevel=[level 1: count=1]

    deletedLNCount=0

    inCount=1

    insByLevel=[level 2: count=1]

    lnCount=1

    mainTreeMaxDepth=2

BTree: Composition of btree, types and counts of nodes.

com.sleepycat.je.EnvironmentFailureException: (JE 6.4.25) /Volumes/mgrandi_256SSD/data/bdb fetchLN of 0x98632/0x20eb4e parent IN=3 IN class="com".sleepycat.je.tree.BIN lastFullLsn=0x988dd/0x1a192845 lastLoggedLsn=0x988dd/0x1e9bd727 parent.getDirty()=true state=0 java.lang.IllegalStateException: java.lang.ClassNotFoundException: com.sg.security.model.entity.ExchangeHoliday$ExchangeDate LOG_INTEGRITY: Log information is incorrect, problem is likely persistent.

    at com.sleepycat.je.tree.IN.fetchLN(IN.java:2867)

    at com.sleepycat.je.tree.IN.fetchLN(IN.java:2746)

    at com.sleepycat.je.dbi.CursorImpl.getCurrentLN(CursorImpl.java:2287)

    at com.sleepycat.je.dbi.DbTree.getDb(DbTree.java:1627)

    at com.sleepycat.je.dbi.DbTree.getDb(DbTree.java:1536)

    at com.sleepycat.je.Environment.setupDatabase(Environment.java:828)

    at com.sleepycat.je.Environment.openDatabase(Environment.java:658)

    at com.sleepycat.je.util.DbVerify.verify(DbVerify.java:317)

    at com.sleepycat.je.util.DbVerify.main(DbVerify.java:134)

Caused by: java.lang.IllegalStateException: java.lang.ClassNotFoundException: com.sg.security.model.entity.ExchangeHoliday$ExchangeDate

    at com.sleepycat.persist.impl.PersistComparator.initialize(PersistComparator.java:133)

    at com.sleepycat.je.dbi.DatabaseImpl.resetKeyComparator(DatabaseImpl.java:1115)

    at com.sleepycat.je.dbi.DatabaseImpl.initWithEnvironment(DatabaseImpl.java:502)

    at com.sleepycat.je.dbi.DatabaseImpl.setEnvironmentImpl(DatabaseImpl.java:1197)

    at com.sleepycat.je.tree.MapLN.postFetchInit(MapLN.java:260)

    at com.sleepycat.je.tree.IN.fetchLN(IN.java:2842)

    ... 8 more

Caused by: java.lang.ClassNotFoundException: com.sg.security.model.entity.ExchangeHoliday$ExchangeDate

    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

    at java.lang.Class.forName0(Native Method)

    at java.lang.Class.forName(Class.java:348)

    at com.sleepycat.util.ClassResolver.resolveClass(ClassResolver.java:155)

    at com.sleepycat.persist.impl.SimpleCatalog.resolveClass(SimpleCatalog.java:117)

    at com.sleepycat.persist.impl.SimpleCatalog.resolveClass(SimpleCatalog.java:295)

    at com.sleepycat.persist.impl.PersistComparator.initialize(PersistComparator.java:131)

    ... 13 more

Exit status = false

Best Answer

  • Greybird-Oracle
    Greybird-Oracle Member Posts: 2,690
    edited May 19, 2016 5:54PM Accepted Answer

    Hi,

    Yes, you have to add the classes/jar that contains com.sg.security.model.entity.ExchangeHoliday$ExchangeDate, and any other key comparators that you use in JE. The key comparators are needed to access and verify the Btree, since they are needed to determine key order.

    --mark

Answers

This discussion has been closed.