找不到类'com.fasterxml.jackson.databind.ObjectMapper'

时间:2013-05-29 12:06:48

标签: android jackson

将eclipse juno升级到ADT的最新版本后,即使早期工作正常,我也无法编译项目。

Could not find class 'com.fasterxml.jackson.databind.ObjectMapper'

完整日志如下

05-29 12:04:04.553: E/dalvikvm(362): Could not find class 'com.fasterxml.jackson.databind.ObjectMapper', referenced from method me.agilani.android.gmitthric.SplashScreenActivity.callWebService
05-29 12:04:07.234: E/AndroidRuntime(362): FATAL EXCEPTION: main
05-29 12:04:07.234: E/AndroidRuntime(362): java.lang.NoClassDefFoundError: com.fasterxml.jackson.databind.ObjectMapper
05-29 12:04:07.234: E/AndroidRuntime(362):  at me.agilani.android.gmitthric.SplashScreenActivity.callWebService(SplashScreenActivity.java:134)
05-29 12:04:07.234: E/AndroidRuntime(362):  at me.agilani.android.gmitthric.SplashScreenActivity.access$3(SplashScreenActivity.java:89)
05-29 12:04:07.234: E/AndroidRuntime(362):  at me.agilani.android.gmitthric.SplashScreenActivity$1.run(SplashScreenActivity.java:65)
05-29 12:04:07.234: E/AndroidRuntime(362):  at android.os.Handler.handleCallback(Handler.java:587)
05-29 12:04:07.234: E/AndroidRuntime(362):  at android.os.Handler.dispatchMessage(Handler.java:92)
05-29 12:04:07.234: E/AndroidRuntime(362):  at android.os.Looper.loop(Looper.java:123)
05-29 12:04:07.234: E/AndroidRuntime(362):  at android.app.ActivityThread.main(ActivityThread.java:3683)
05-29 12:04:07.234: E/AndroidRuntime(362):  at java.lang.reflect.Method.invokeNative(Native Method)
05-29 12:04:07.234: E/AndroidRuntime(362):  at java.lang.reflect.Method.invoke(Method.java:507)
05-29 12:04:07.234: E/AndroidRuntime(362):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-29 12:04:07.234: E/AndroidRuntime(362):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-29 12:04:07.234: E/AndroidRuntime(362):  at dalvik.system.NativeStart.main(Native Method)

我尝试将jackson库升级到2.2.1,但无济于事...... 有人可以帮忙解决这个问题......

3 个答案:

答案 0 :(得分:1)

首先,检查您的构建路径,确保已将lib添加到构建路径中。另外,清理项目。

答案 1 :(得分:0)

以某种方式升级IDE后,Build路径生效。从构建路径中取出外部jar,多次清理解决方案,然后再次添加它们。诀窍。

答案 2 :(得分:0)

for me org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;和MappingJacksonHttpMessageConverter混淆了fastxml jackson所以在gradle clean之后现在正在工作