title: AWS Lambda S3Event deserialization
body: <p>Has anyone successfully implemented a Java based request handler for S3 events? </p>
  
  <p>My class:</p>
  
  <pre><code>package example;
  
  import com.amazonaws.services.lambda.runtime.Context;
  import com.amazonaws.services.lambda.runtime.RequestHandler;
  import com.amazonaws.services.s3.model.S3Event;
  
  public class Hello implements RequestHandler&lt;S3Event, String&gt; {
      public String handleRequest(S3Event event, Context context) {
          return "Success";
      }
  }
  </code></pre>
  
  <p>Error message:</p>
  
  <p><em>An error occurred during JSON parsing: java.lang.RuntimeException java.lang.RuntimeException: An error occurred during JSON parsing Caused by: java.io.UncheckedIOException: com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of com.amazonaws.services.s3.model.S3Event out of START_OBJECT token at [Source: lambdainternal.util.NativeMemoryAsInputStream@6108b2d7; line: 1, column: 1] Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of com.amazonaws.services.s3.model.S3Event out of START_OBJECT token at [Source: lambdainternal.util.NativeMemoryAsInputStream@6108b2d7; line: 1, column: 1] at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148) at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:835) at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:831) at com.fasterxml.jackson.databind.deser.std.EnumDeserializer._deserializeOther(EnumDeserializer.java:137) at com.fasterxml.jackson.databind.deser.std.EnumDeserializer.deserialize(EnumDeserializer.java:89) at com.fasterxml.jackson.databind.deser.std.EnumDeserializer.deserialize(EnumDeserializer.java:18) at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1441) at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1047)</em></p>