NoClassDefFoundError/ExceptionInInitializerError on Android 2.3.3 and Jackson 2.9.0
See original GitHub issueI discovered a NoClassDefFoundError
/ExceptionInInitializerError
when I run this Android app in the following environment:
- Samsung GT-I9000
- Android 2.3.3 (API level 8, Froyo)
- no Google Play Services installed
com.fasterxml.jackson.core:jackson-databind:2.9.0 - 2.9.2
- crash happens for
DEBUG
andRELEASE
builds
Here is the excerpt which causes the crash. The full source code can be found here (commit: 4da721846ad4c9bca030fc1167aff3d8754abb72
).
111 SimpleModule module = new SimpleModule();
112 module.addDeserializer(Circuit.class, new CircuitDeserializer());
113 ObjectMapper objectMapper = new ObjectMapper(); // <-- crash
114 objectMapper.registerModule(module);
The following stacktrace is generated when I open the FaqActivity
from the toolbar menu:
java.lang.ExceptionInInitializerError
at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:577)
at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:480)
at de.avpptr.umweltzone.utils.ContentProvider.getContent(ContentProvider.java:113)
at de.avpptr.umweltzone.utils.ContentProvider.getContent(ContentProvider.java:98)
at de.avpptr.umweltzone.utils.ContentProvider.getFaqs(ContentProvider.java:68)
at de.avpptr.umweltzone.faqs.FaqActivity.onCreate(FaqActivity.java:40)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
...
Caused by: java.lang.ExceptionInInitializerError
at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.<clinit>(BasicDeserializerFactory.java:49)
... 19 more
Caused by: java.lang.NoClassDefFoundError: com.fasterxml.jackson.databind.util.ClassUtil
at com.fasterxml.jackson.databind.PropertyName.<init>(PropertyName.java:66)
at com.fasterxml.jackson.databind.PropertyName.<clinit>(PropertyName.java:29)
... 20 more
Findings
- The crash can be reproduced with the
system-images;android-10;google_apis;x86
emulator image (Android 2.3.3, Google APIs) - The crash does not occur when I use
jackson-databind:2.8.10
. - The crash does not happen on another device: Nexus 5, Android 6.0.1, Google Play Services installed.
- The crash does not occur on Android 4.1, API level 16 (tested with
system-images;android-16;google_apis;x86
emulator).
Related issues
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
java.lang.NoClassDefFoundError: com/fasterxml/jackson/core ...
I have no idea why this works. I already had version 2.3.3., which is where the error arrrived, but changing the version of...
Read more >com.fasterxml.jackson.core:jackson-databind@2.3.3
Affected versions of this package are vulnerable to Deserialization of Untrusted Data. The package mishandles the interaction between serialization gadgets and ...
Read more >Jackson Dataformat YAML - Maven Repository
Support for reading and writing YAML-encoded data via Jackson abstractions. License, Apache 2.0. Categories, YAML ParsersData Formats. Tags, formatyamljson ...
Read more >com.fasterxml.jackson.core:jackson-databind | Maven
com.fasterxml.jackson.dataformat:jackson-dataformat-xml, Version, 2.9.0, Relation, Direct ... com.lifeonwalden:app-common, Version, 1.0.9, Relation, Direct.
Read more >Overview (jackson-databind 2.9.1 API) - Javadoc.io
Basic data binding (mapping) functionality that allows for reading JSON content into Java Objects (POJOs) and JSON Trees ( JsonNode ), as well...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@johnjohndoe Yes, there’s diminishing return on back-porting, and Google does tend to push for newer versions (since older versions are costly to support for them too).
And yes, security issues are a class of problems for which new versions are theoretically possible for even otherwise closed branches. 2.8 is not yet officially closed, however, and I suspect I will be doing full 2.8.11 release at some point. Beyond this, micro-patches are a possibility. As to major bugs, perhaps, depends on type of bug in question. I don’t think I have done that yet for a closed minor branch (unlike security patch or two), but I would not rule that out.
@johnjohndoe ☝️