使用Jackcess抛出代码覆盖异常读取加密的Access .mdb

时间:2017-06-21 15:55:50

标签: java ucanaccess jackcess

我正在尝试使用以下库读取加密的Access .mdb:

  • Jackcess-2.1.6
  • Jackcess-encrypt-2.1.2
  • Ucanaccess-4.0.2
  • bcprov-jdk15on-157

按照Ucanaccess's documentation简单地实现JackcessOpenerInterface:

public class CryptCodecOpener implements JackcessOpenerInterface {
    public Database open(File fl, String pwd) throws IOException {
        DatabaseBuilder dbd =new DatabaseBuilder(fl);
        dbd.setAutoSync(false);
        dbd.setCodecProvider(new CryptCodecProvider(pwd));
        dbd.setReadOnly(false);
        return dbd.open();

    }
}

我得到以下异常:

Exception in thread "main" java.lang.NoClassDefFoundError: net/sourceforge/cobertura/coveragedata/TouchCollector
    at com.healthmarketscience.jackcess.CryptCodecProvider.__cobertura_init(CryptCodecProvider.java)
    at com.healthmarketscience.jackcess.CryptCodecProvider.<clinit>(CryptCodecProvider.java)
    at com.decode.CryptCodecOpener.open(CryptCodecOpener.java:29)
    at net.ucanaccess.jdbc.DBReference.<init>(DBReference.java:161)
    at net.ucanaccess.jdbc.DBReferenceSingleton.loadReference(DBReferenceSingleton.java:51)
    at net.ucanaccess.jdbc.UcanaccessDriver.connect(UcanaccessDriver.java:99)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:247)
    at com.decode.Importer.importFromDatabase(Importer.java:41)
    at com.decode.Main.main(Main.java:10)
Caused by: java.lang.ClassNotFoundException: net.sourceforge.cobertura.coveragedata.TouchCollector
    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)

从我收集的内容来看,Cobertura是Java的代码覆盖实用程序。这只是一个坏罐子还是我做错了什么?

0 个答案:

没有答案