本文介绍了Jackcess“NoClassDefFoundError"例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 jackcess 连接到我的访问数据库.但我正在关注异常

I am using jackcess for the conncetivity to my access database. But I am following exception

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/builder/CompareToBuilder
    at com.healthmarketscience.jackcess.impl.RowIdImpl.compareTo(RowIdImpl.java:113)
    at com.healthmarketscience.jackcess.impl.IndexData$Entry.compareTo(IndexData.java:1838)
    at com.healthmarketscience.jackcess.impl.IndexData$Entry.compareTo(IndexData.java:1646)
    at java.util.Collections.indexedBinarySearch(Collections.java:273)
    at java.util.Collections.binarySearch(Collections.java:259)
    at com.healthmarketscience.jackcess.impl.IndexData$DataPage.findEntry(IndexData.java:2368)
    at com.healthmarketscience.jackcess.impl.IndexData.findEntryPosition(IndexData.java:722)
    at com.healthmarketscience.jackcess.impl.IndexData.access$3300(IndexData.java:56)
    at com.healthmarketscience.jackcess.impl.IndexData$EntryCursor.updatePosition(IndexData.java:2133)
    at com.healthmarketscience.jackcess.impl.IndexData$EntryCursor.restorePosition(IndexData.java:2072)
    at com.healthmarketscience.jackcess.impl.IndexData$EntryCursor.restorePosition(IndexData.java:2055)
    at com.healthmarketscience.jackcess.impl.IndexData$EntryCursor.beforeEntry(IndexData.java:2017)
    at com.healthmarketscience.jackcess.impl.IndexCursorImpl.findPotentialRow(IndexCursorImpl.java:368)
    at com.healthmarketscience.jackcess.impl.IndexCursorImpl.findFirstRowByEntryImpl(IndexCursorImpl.java:262)
    at com.healthmarketscience.jackcess.impl.IndexCursorImpl.findFirstRowByEntry(IndexCursorImpl.java:135)
    at com.healthmarketscience.jackcess.impl.DatabaseImpl$DefaultTableFinder.findRow(DatabaseImpl.java:1890)
    at com.healthmarketscience.jackcess.impl.DatabaseImpl$TableFinder.findObjectId(DatabaseImpl.java:1799)
    at com.healthmarketscience.jackcess.impl.DatabaseImpl.readSystemCatalog(DatabaseImpl.java:804)
    at com.healthmarketscience.jackcess.impl.DatabaseImpl.<init>(DatabaseImpl.java:513)
    at com.healthmarketscience.jackcess.impl.DatabaseImpl.open(DatabaseImpl.java:386)
    at com.healthmarketscience.jackcess.DatabaseBuilder.open(DatabaseBuilder.java:170)
    at com.healthmarketscience.jackcess.DatabaseBuilder.open(DatabaseBuilder.java:193)
    at ass.Access.main(Access.java:25)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.builder.CompareToBuilder
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 23 more

我使用过 jdbc 但它也不起作用.如何解决我的问题?

I have used jdbc but it is not working either. How can solve my problem?

推荐答案

Jackcess 有一个 依赖项Jakarta Commons Lang.您需要确保公共语言和其他依赖项在您的类路径上.

Jackcess has a dependency on Jakarta Commons Lang. You need to make sure that the commons lang and the other dependencies are on your classpath.

这篇关于Jackcess“NoClassDefFoundError"例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 03:43