maven - Error putting item in DynamoDB with AWS Java SDK and Hadoop -
i'm using hadoop 2.7, hadoop-core version 1.1.2 , aws java sdk 1.10.50.
when attempt put item on dynamodb, following error:
java.lang.nosuchfielderror: instance @ com.amazonaws.http.conn.sdkconnectionkeepalivestrategy.getkeepaliveduration(sdkconnectionkeepalivestrategy.java:48)
what found error due conflict of aws sdk , httpcore version.
running in code:
classloader classloader = myclass.class.getclassloader(); url resource = classloader.getresource("org/apache/http/message/basiclineformatter.class"; system.out.println(resource);
the output is:
jar:file:/usr/local/cellar/hadoop/2.7.0/libexec/share/hadoop/common/lib/httpcore-4.2.5.jar!/org/apache/http/message/basiclineformatter.class
indicating still using conflicting version.
but on pom.xml, i've added:
<dependency> <groupid>org.apache.httpcomponents</groupid> <artifactid>httpclient</artifactid> <version>4.4.1</version> <scope>compile</scope> </dependency> <dependency> <groupid>org.apache.httpcomponents</groupid> <artifactid>httpcore</artifactid> <version>4.4.1</version> <scope>compile</scope> </dependency>
trying force compatible version sdk, code still uses conflicting version.
anyone know how can force application use non-conflicting version of httpcore , httpclient?
you can add dependency on version of httpclient need , exclude httpclient transient dependency dependency pulls in version 4.2.5. use mvn dependency:tree
determine add exclusion.
Comments
Post a Comment