I am developing a webapp using Amazon\'s cloud services and I need to make use of JSON objects. How my project is set up is, I have an HTML form where the user will fill in
If you use maven and have all libraries in place as in my case a simple mvn clean
and mvn install
fixed problem.
Or the following gradle configuration:
compile 'com.fasterxml.jackson.core:jackson-core:2.2.2'
compile 'com.fasterxml.jackson.core:jackson-databind:2.2.2'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.2'
For those who come here in the future, the answer is:
If you've only copied jackson core
and jackson databind
, you need jackson annotations
to use the ObjectMapper
.
For example, make sure you have something like this:
[16:32:01]:/android-project/libs master]$ ls -lAF
total 2112
-rw-r--r--@ 1 jeffamaphone staff 33525 Jun 18 16:06 jackson-annotations-2.0.2.jar
-rw-r--r--@ 1 jeffamaphone staff 193693 Jun 7 16:42 jackson-core-2.0.2.jar
-rw-r--r--@ 1 jeffamaphone staff 847121 Jun 18 15:22 jackson-databind-2.0.2.jar
To expand on @jeffamaphone's excellent answer, for maven users
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.7.3</version>
</dependency>
If you are/were using tomcat while developing in eclipse and got this error(maybe because you pressed republish/clean),
a right click on the project->Maven->Update Project...
solved this issue for me.
In addition, i did include also the dependencies from Johan Sjöberg