0

I am coming from a ruby programming background and I have started learning java. I absolutely fell in love with it. Right now I am trying to run the sample aws iot java sdk project but I keep getting this err.

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

The import com.fasterxml.jackson.databind.DeserializationFeature cannot be resolved

When I looked inside the maven dependency folder and navigated to com.fasterxml.jackson.databind I did not find any class with DeserializationFeature as well as ObjectMapper

Any idea?

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.amazonaws</groupId>
    <artifactId>aws-iot-device-sdk-java-pom</artifactId>
    <version>1.0.1</version>
  </parent>
  <artifactId>aws-iot-device-sdk-java-samples</artifactId>
  <dependencies>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-iot-device-sdk-java</artifactId>
      <version>1.0.1</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.5.1</version>
          <configuration>
            <excludes>
              <exclude>com/amazonaws/services/iot/client/sample/odin/*.java</exclude>
            </excludes>
          </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.3</version>
        <configuration>
          <excludePackageNames>*.odin.*</excludePackageNames>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

2 Answers2

1

Can you confirm the version of the jar .... its part of jackson.databind.jar ... you might need the correct version

kanishka vatsa
  • 2,074
  • 18
  • 8
1

You need to add dependency for jackson-databind

    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.8.0</version>
    </dependency>
ravthiru
  • 8,878
  • 2
  • 43
  • 52