aws-sdk-java: Exception while initializing AmazonS3Client

When calling:

new AmazonS3Client(new ProfileCredentialsProvider().getCredentials())

This exception occurs:

Exception in thread "main" java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectMapper.enable([Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/jackson/databind/ObjectMapper;
        at com.amazonaws.internal.config.InternalConfig.<clinit>(InternalConfig.java:43)
        at com.amazonaws.internal.config.InternalConfig$Factory.<clinit>(InternalConfig.java:304)
        at com.amazonaws.util.VersionInfoUtils.userAgent(VersionInfoUtils.java:139)
        at com.amazonaws.util.VersionInfoUtils.initializeUserAgent(VersionInfoUtils.java:134)
        at com.amazonaws.util.VersionInfoUtils.getUserAgent(VersionInfoUtils.java:95)
        at com.amazonaws.ClientConfiguration.<clinit>(ClientConfiguration.java:53)
        at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:384)

"com.amazonaws" % "aws-java-sdk" % "1.10.34"

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Reactions: 4
  • Comments: 30 (10 by maintainers)

Most upvoted comments

overriding is easy. Add WEB-INF/glassfish-web.xml to your webapp with later jackson dependencies with this content:

<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD 
GlassFish Application Server 3.1 Servlet 3.0//EN" 
"http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
   <class-loader delegate="false"/>
</glassfish-web-app>

Despite the references to 3.1 in DOCTYPE it works fine with 4.1.1.