Android - Apache Commons DbUtils - исключение QueryRunner - PullRequest
0 голосов
/ 07 декабря 2018

Я использую в своем приложении Apache Commons DbUtils (https://commons.apache.org/proper/commons-dbutils/).

Я добавил файл jar (commons-dbutils-1.7.jar) в папку libs. Тогда у меня есть этот код:

             ResultSetHandler<List<Objekt>> h = new BeanListHandler<Objekt>(Objekt.class);
             QueryRunner run = new QueryRunner();
             List<Objekt> persons = run.query(conn, "select * from C_OBJEKT", h);

И в последнем ряду я получаю это исключение:

12-12 14:33:46.939 24150-24210/com.tempus.touch W/art: Unresolved exception class when finding catch block: java.beans.IntrospectionException
12-12 14:33:46.939 24150-24210/com.tempus.touch E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
    Process: com.tempus.touch, PID: 24150
    java.lang.NoClassDefFoundError: Failed resolution of: Ljava/beans/Introspector;
        at org.apache.commons.dbutils.BeanProcessor.propertyDescriptors(BeanProcessor.java:432)
        at org.apache.commons.dbutils.BeanProcessor.toBeanList(BeanProcessor.java:197)
        at org.apache.commons.dbutils.BasicRowProcessor.toBeanList(BasicRowProcessor.java:140)
        at org.apache.commons.dbutils.handlers.BeanListHandler.handle(BeanListHandler.java:83)
        at org.apache.commons.dbutils.handlers.BeanListHandler.handle(BeanListHandler.java:34)
        at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:388)
        at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:266)
        at com.tempus.touch.MainActivity$3.run(MainActivity.java:160)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "java.beans.Introspector" on path: DexPathList[[zip file "/data/app/com.tempus.touch-1/base.apk", zip file "/data/app/com.tempus.touch-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.tempus.touch-1/lib/arm, /vendor/lib, /system/lib]]

Что не так? Что мне делать? Импортировать какую-то другую библиотеку?

Спасибо за помощь!

...