我试图在安卓应用程序中使用Ektorp CouchDB库,我总是得到这样的例外:
java.lang.NoClassDefFoundError: org.ektorp.impl.docref.DocumentReferenceSerializerProvider这是我的代码:
HttpClient authenticatedHttpClient = new StdHttpClient.Builder().host("myhostname").port(5984).username("username").password("password").build();
CouchDbInstance dbInstance = new StdCouchDbInstance(authenticatedHttpClient);
CouchDbConnector db = dbInstance.createConnector("luscinia", true);异常总是发生在上述代码的最后一行。
我在这里跟踪了erktop wiki关于依赖关系的内容:http://code.google.com/p/ektorp/wiki/dependencies
这将导致我的项目包括:
LogCat在异常之前给我一个警告和一个错误行,也许它们可以帮助我:
Link of class 'Lorg/ektorp/impl/docref/DocumentReferenceSerializerProvider;' failed
Could not find class 'org.ektorp.impl.docref.DocumentReferenceSerializerProvider', referenced from method org.ektorp.impl.StdObjectMapperFactory.createObjectMapper我不明白他们的意思。知道吗?
发布于 2011-06-15 15:32:19
恐怕Ektorp 1.1.1和杰克逊1.8不兼容。这个问题将在今年夏天发布的1.2.0版本中得到修正。同时使用Jackson 1.7.7。
发布于 2011-06-15 14:14:54
我不是一个java编码专家,但我设想java对象在异常之前扩展,而不是运行在android上的java实现的一部分。Dalvik不是标准jvm。我推荐这个用于安卓沙发的https://github.com/couchone/libcouch-android库。
https://stackoverflow.com/questions/6358691
复制相似问题