Closed alxgrk closed 4 years ago
I have the same problem with S3Client.getObject @alxgrk
I was having this issue with S3Client.putObject, version 2.0.0-preview-12. I also had org.apache.httpcomponents:httpclient:4.5.3 on my classpath from another dependency. After updating httpclient to 4.5.5, the error is no longer occurring.
I upgrade to v '2.0.2' and the error is gone.
@Initial-B - updating org.apache.httpcomponents:httpclient to 4.5.5 unfortunately didn't solve the problem for me.
@vbudilov - the 'fixed' versions 2.0.* are only released for kinesis, cloudwatch and dynamodb, not cloudsearch.
So these solutions might work for some other AWS services, but not for my original issue.
@alxgrk Sorry to see you're still experiencing this issue. As @Initial-B pointed out, this is probably a dependency mismatch issue.
Could you show the output of mvn dependency:tree
? This will show if the httpclient
dependency is the correct version.
Hey @dagnir, thanks for your response.
Here's the output of mvn dependency:tree
:
[INFO] +- org.springframework:spring-messaging:jar:4.3.18.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:4.3.7.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:4.3.7.RELEASE:compile
[INFO] | | \- org.springframework:spring-expression:jar:4.3.7.RELEASE:compile
[INFO] | \- org.springframework:spring-core:jar:4.3.7.RELEASE:compile
[INFO] +- commons-beanutils:commons-beanutils:jar:1.9.3:compile
[INFO] | \- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] +- org.jolokia:jolokia-core:jar:1.3.5:compile
[INFO] | \- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:1.4.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.4.5.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.4.5.RELEASE:compile
[INFO] | | \- org.springframework.boot:spring-boot-starter-logging:jar:1.4.5.RELEASE:compile
[INFO] | | +- ch.qos.logback:logback-classic:jar:1.1.11:compile
[INFO] | | | \- ch.qos.logback:logback-core:jar:1.1.11:compile
[INFO] | | +- org.slf4j:jul-to-slf4j:jar:1.7.24:compile
[INFO] | | \- org.slf4j:log4j-over-slf4j:jar:1.7.24:compile
[INFO] | \- org.springframework.boot:spring-boot-actuator:jar:1.4.5.RELEASE:compile
[INFO] +- com.mercateo.boot:metrics-spring-boot-starter:jar:0.1.1:compile
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.5.RELEASE:compile
[INFO] | +- io.dropwizard.metrics:metrics-core:jar:3.1.3:compile
[INFO] | +- io.dropwizard.metrics:metrics-jvm:jar:3.1.3:compile
[INFO] | \- io.github.mweirauch:metrics-jvm-extras:jar:0.1.3:compile
[INFO] +- org.hamcrest:hamcrest-junit:jar:2.0.0.0:test
[INFO] | +- junit:junit:jar:4.12:compile
[INFO] | \- org.hamcrest:java-hamcrest:jar:2.0.0.0:test
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.4.5.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:1.4.5.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.4.5.RELEASE:test
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.2.0:test
[INFO] | | \- net.minidev:json-smart:jar:2.2.1:test
[INFO] | | \- net.minidev:accessors-smart:jar:1.1:test
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.3.0:test
[INFO] | \- org.springframework:spring-test:jar:4.3.7.RELEASE:test
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.4.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:1.4.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.4.5.RELEASE:compile
[INFO] | | +- org.apache.tomcat:tomcat-jdbc:jar:8.5.11:compile
[INFO] | | | \- org.apache.tomcat:tomcat-juli:jar:8.5.11:compile
[INFO] | | \- org.springframework:spring-jdbc:jar:4.3.7.RELEASE:compile
[INFO] | +- org.hibernate:hibernate-core:jar:5.0.12.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
[INFO] | | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] | | +- org.javassist:javassist:jar:3.20.0-GA:compile
[INFO] | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | +- org.jboss:jandex:jar:2.0.0.Final:compile
[INFO] | | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO] | +- org.hibernate:hibernate-entitymanager:jar:5.0.12.Final:compile
[INFO] | +- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] | \- org.springframework.data:spring-data-jpa:jar:1.10.8.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-commons:jar:1.12.8.RELEASE:compile
[INFO] | +- org.springframework:spring-orm:jar:4.3.7.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:4.3.7.RELEASE:compile
[INFO] +- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:compile
[INFO] | +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | \- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
[INFO] +- org.zalando:faux-pas:jar:0.2.0:compile
[INFO] | +- com.google.code.findbugs:jsr305:jar:3.0.1:compile
[INFO] | +- com.google.gag:gag:jar:1.0.1:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.24:compile
[INFO] +- com.ryantenney.metrics:metrics-spring:jar:3.1.3:compile
[INFO] | +- io.dropwizard.metrics:metrics-healthchecks:jar:3.1.2:compile
[INFO] | +- io.dropwizard.metrics:metrics-annotation:jar:3.1.2:compile
[INFO] | +- org.springframework:spring-context-support:jar:4.3.7.RELEASE:compile
[INFO] | \- org.springframework:spring-aop:jar:4.3.7.RELEASE:compile
[INFO] +- org.modelmapper:modelmapper:jar:1.1.0:compile
[INFO] +- com.h2database:h2:jar:1.4.193:test
[INFO] +- org.postgresql:postgresql:jar:9.4.1212.jre7:compile
[INFO] +- org.liquibase:liquibase-core:jar:3.5.3:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.17:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.4.5.RELEASE:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.3.3:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.7:compile
[INFO] | +- org.springframework:spring-web:jar:4.3.7.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.3.7.RELEASE:compile
[INFO] +- com.google.guava:guava:jar:21.0:compile
[INFO] +- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- com.google.guava:guava-testlib:jar:18.0:test
[INFO] | \- com.google.truth:truth:jar:0.23:test
[INFO] +- org.springframework:spring-aspects:jar:4.3.7.RELEASE:compile
[INFO] | \- org.aspectj:aspectjweaver:jar:1.8.9:compile
[INFO] +- org.projectlombok:lombok:jar:1.16.14:provided
[INFO] +- org.mapstruct:mapstruct-jdk8:jar:1.2.0.Final:compile
[INFO] +- org.mapstruct:mapstruct-processor:jar:1.2.0.Final:provided
[INFO] +- org.springframework.cloud:spring-cloud-starter-aws:jar:1.1.3.RELEASE:compile
[INFO] | +- org.springframework.cloud:spring-cloud-aws-context:jar:1.1.3.RELEASE:compile
[INFO] | | \- org.springframework.cloud:spring-cloud-aws-core:jar:1.1.3.RELEASE:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-s3:jar:1.11.18:compile
[INFO] | | | \- com.amazonaws:aws-java-sdk-kms:jar:1.11.18:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-ec2:jar:1.11.18:compile
[INFO] | | \- com.amazonaws:aws-java-sdk-cloudformation:jar:1.11.18:compile
[INFO] | \- org.springframework.cloud:spring-cloud-aws-autoconfigure:jar:1.1.3.RELEASE:compile
[INFO] | +- org.springframework.cloud:spring-cloud-aws-actuator:jar:1.1.3.RELEASE:compile
[INFO] | +- com.amazonaws:aws-java-sdk-ses:jar:1.11.18:compile
[INFO] | +- com.amazonaws:aws-java-sdk-cloudwatch:jar:1.11.18:compile
[INFO] | +- javax.mail:javax.mail-api:jar:1.5.6:compile
[INFO] | +- com.amazonaws:elasticache-java-cluster-client:jar:1.1.0:compile
[INFO] | \- com.amazonaws:aws-java-sdk-elasticache:jar:1.11.18:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-aws-jdbc:jar:1.1.3.RELEASE:compile
[INFO] | \- org.springframework.cloud:spring-cloud-aws-jdbc:jar:1.1.3.RELEASE:compile
[INFO] | +- com.amazonaws:aws-java-sdk-rds:jar:1.11.18:compile
[INFO] | \- com.amazonaws:aws-java-sdk-iam:jar:1.11.18:compile
[INFO] +- joda-time:joda-time:jar:2.9.7:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-aws-messaging:jar:1.1.3.RELEASE:compile
[INFO] | \- org.springframework.cloud:spring-cloud-aws-messaging:jar:1.1.3.RELEASE:compile
[INFO] | +- com.amazonaws:aws-java-sdk-sns:jar:1.11.18:compile
[INFO] | \- com.amazonaws:aws-java-sdk-sqs:jar:1.11.18:compile
[INFO] +- org.glassfish.hk2:spring-bridge:jar:2.5.0-b36:compile
[INFO] | \- org.glassfish.hk2:hk2-api:jar:2.5.0-b36:compile
[INFO] | \- org.glassfish.hk2:hk2-utils:jar:2.5.0-b36:compile
[INFO] +- org.springframework.boot:spring-boot-starter-jetty:jar:1.4.5.RELEASE:compile
[INFO] | +- org.eclipse.jetty:jetty-servlets:jar:9.3.16.v20170120:compile
[INFO] | | +- org.eclipse.jetty:jetty-continuation:jar:9.3.16.v20170120:compile
[INFO] | | +- org.eclipse.jetty:jetty-http:jar:9.3.16.v20170120:compile
[INFO] | | +- org.eclipse.jetty:jetty-util:jar:9.3.16.v20170120:compile
[INFO] | | \- org.eclipse.jetty:jetty-io:jar:9.3.16.v20170120:compile
[INFO] | +- org.eclipse.jetty:jetty-webapp:jar:9.3.16.v20170120:compile
[INFO] | | +- org.eclipse.jetty:jetty-xml:jar:9.3.16.v20170120:compile
[INFO] | | \- org.eclipse.jetty:jetty-servlet:jar:9.3.16.v20170120:compile
[INFO] | | \- org.eclipse.jetty:jetty-security:jar:9.3.16.v20170120:compile
[INFO] | | \- org.eclipse.jetty:jetty-server:jar:9.3.16.v20170120:compile
[INFO] | +- org.eclipse.jetty.websocket:websocket-server:jar:9.3.16.v20170120:compile
[INFO] | | +- org.eclipse.jetty.websocket:websocket-common:jar:9.3.16.v20170120:compile
[INFO] | | | \- org.eclipse.jetty.websocket:websocket-api:jar:9.3.16.v20170120:compile
[INFO] | | +- org.eclipse.jetty.websocket:websocket-client:jar:9.3.16.v20170120:compile
[INFO] | | \- org.eclipse.jetty.websocket:websocket-servlet:jar:9.3.16.v20170120:compile
[INFO] | \- org.eclipse.jetty.websocket:javax-websocket-server-impl:jar:9.3.16.v20170120:compile
[INFO] | +- org.eclipse.jetty:jetty-annotations:jar:9.3.16.v20170120:compile
[INFO] | | \- org.eclipse.jetty:jetty-plus:jar:9.3.16.v20170120:compile
[INFO] | +- org.eclipse.jetty.websocket:javax-websocket-client-impl:jar:9.3.16.v20170120:compile
[INFO] | \- javax.websocket:javax.websocket-api:jar:1.0:compile
[INFO] +- com.mercateo.rest:rest-schemagen-spring:jar:0.2.0:compile
[INFO] | +- com.mercateo:common.rest.schemagen:jar:0.18.15:compile
[INFO] | | +- com.mercateo:reflection:jar:1.2.14:compile
[INFO] | | | +- net.bytebuddy:byte-buddy:jar:1.7.11:compile
[INFO] | | | \- org.cache2k:cache2k-core:jar:1.0.2.Final:compile
[INFO] | | | \- org.cache2k:cache2k-api:jar:1.0.2.Final:compile
[INFO] | | +- org.reflections:reflections:jar:0.9.11:compile
[INFO] | | +- com.googlecode.gentyref:gentyref:jar:1.2.0:compile
[INFO] | | \- org.glassfish.jersey.media:jersey-media-multipart:jar:2.25.1:compile
[INFO] | | \- org.jvnet.mimepull:mimepull:jar:1.9.6:compile
[INFO] | \- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO] +- org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-inmemory:jar:2.25.1:test
[INFO] | +- org.glassfish.jersey.test-framework:jersey-test-framework-core:jar:2.25.1:test
[INFO] | +- org.glassfish.jersey.core:jersey-server:jar:2.23.2:compile
[INFO] | | +- org.glassfish.jersey.core:jersey-common:jar:2.23.2:compile
[INFO] | | | +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.23.2:compile
[INFO] | | | \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
[INFO] | | +- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.23.2:compile
[INFO] | | +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] | | +- org.glassfish.hk2.external:javax.inject:jar:2.5.0-b05:compile
[INFO] | | \- org.glassfish.hk2:hk2-locator:jar:2.5.0-b05:compile
[INFO] | \- org.glassfish.jersey.core:jersey-client:jar:2.25.1:compile
[INFO] +- org.assertj:assertj-core:jar:3.10.0:test
[INFO] +- org.json:json:jar:20140107:compile
[INFO] +- io.rest-assured:rest-assured:jar:3.0.6:test
[INFO] | +- org.codehaus.groovy:groovy:jar:2.4.9:test
[INFO] | +- org.codehaus.groovy:groovy-xml:jar:2.4.9:test
[INFO] | +- org.apache.httpcomponents:httpmime:jar:4.5.3:test
[INFO] | +- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:test
[INFO] | +- io.rest-assured:json-path:jar:3.0.6:test
[INFO] | | +- org.codehaus.groovy:groovy-json:jar:2.4.9:test
[INFO] | | \- io.rest-assured:rest-assured-common:jar:3.0.6:test
[INFO] | \- io.rest-assured:xml-path:jar:3.0.6:test
[INFO] | +- org.apache.commons:commons-lang3:jar:3.4:test
[INFO] | \- javax.xml.bind:jaxb-api:jar:2.2.12:test
[INFO] +- org.springframework.boot:spring-boot-starter-jersey:jar:1.4.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-validation:jar:1.4.5.RELEASE:compile
[INFO] | +- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.23.2:compile
[INFO] | +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.23.2:compile
[INFO] | +- org.glassfish.jersey.ext:jersey-bean-validation:jar:2.23.2:compile
[INFO] | +- org.glassfish.jersey.ext:jersey-spring3:jar:2.23.2:compile
[INFO] | | \- org.glassfish.hk2:hk2:jar:2.5.0-b05:compile
[INFO] | | +- org.glassfish.hk2:config-types:jar:2.5.0-b05:compile
[INFO] | | +- org.glassfish.hk2:hk2-core:jar:2.5.0-b05:compile
[INFO] | | +- org.glassfish.hk2:hk2-config:jar:2.5.0-b05:compile
[INFO] | | +- org.glassfish.hk2:hk2-runlevel:jar:2.5.0-b05:compile
[INFO] | | \- org.glassfish.hk2:class-model:jar:2.5.0-b05:compile
[INFO] | | \- org.glassfish.hk2.external:asm-all-repackaged:jar:2.5.0-b05:compile
[INFO] | \- org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.23.2:compile
[INFO] | +- org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.23.2:compile
[INFO] | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.8.7:compile
[INFO] | \- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.8.7:compile
[INFO] | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.8.7:compile
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.4.5.RELEASE:test
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.11:test
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.11:test
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.11:test
[INFO] +- com.amazonaws:aws-java-sdk-cloudsearch:jar:1.11.18:compile
[INFO] | \- com.amazonaws:aws-java-sdk-core:jar:1.11.18:compile
[INFO] | \- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.8.7:compile
[INFO] +- software.amazon.awssdk:cloudsearchdomain:jar:2.0.0-preview-11:compile
[INFO] | +- software.amazon.awssdk:sdk-core:jar:2.0.0-preview-11:compile
[INFO] | | +- software.amazon.ion:ion-java:jar:1.2.0:compile
[INFO] | | \- org.reactivestreams:reactive-streams:jar:1.0.2:compile
[INFO] | +- software.amazon.awssdk:auth:jar:2.0.0-preview-11:compile
[INFO] | | \- software.amazon.awssdk:profiles:jar:2.0.0-preview-11:compile
[INFO] | +- software.amazon.awssdk:http-client-spi:jar:2.0.0-preview-11:compile
[INFO] | +- software.amazon.awssdk:regions:jar:2.0.0-preview-11:compile
[INFO] | | \- com.fasterxml.jackson.jr:jackson-jr-objects:jar:2.9.6:compile
[INFO] | +- software.amazon.awssdk:annotations:jar:2.0.0-preview-11:compile
[INFO] | +- software.amazon.awssdk:utils:jar:2.0.0-preview-11:compile
[INFO] | +- software.amazon.awssdk:aws-core:jar:2.0.0-preview-11:compile
[INFO] | +- software.amazon.awssdk:apache-client:jar:2.0.0-preview-11:runtime
[INFO] | \- software.amazon.awssdk:netty-nio-client:jar:2.0.0-preview-11:runtime
[INFO] | +- io.netty:netty-codec-http:jar:4.1.26.Final:runtime
[INFO] | +- io.netty:netty-codec:jar:4.1.26.Final:runtime
[INFO] | +- io.netty:netty-transport:jar:4.1.26.Final:runtime
[INFO] | | \- io.netty:netty-resolver:jar:4.1.26.Final:runtime
[INFO] | +- io.netty:netty-common:jar:4.1.26.Final:runtime
[INFO] | +- io.netty:netty-buffer:jar:4.1.26.Final:runtime
[INFO] | +- io.netty:netty-handler:jar:4.1.26.Final:runtime
[INFO] | +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.26.Final:runtime
[INFO] | | \- io.netty:netty-transport-native-unix-common:jar:4.1.26.Final:runtime
[INFO] | \- com.typesafe.netty:netty-reactive-streams-http:jar:2.0.0:runtime
[INFO] | \- com.typesafe.netty:netty-reactive-streams:jar:2.0.0:runtime
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.5.6:compile
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.6:compile
[INFO] | \- commons-codec:commons-codec:jar:1.10:compile
[INFO] +- io.logz.logback:logzio-logback-appender:jar:1.0.16:compile
[INFO] +- io.github.benas:random-beans:jar:3.7.0:test
[INFO] | +- org.objenesis:objenesis:jar:2.5.1:compile
[INFO] | \- io.github.lukehutch:fast-classpath-scanner:jar:2.2.1:test
[INFO] +- com.jsoniter:jsoniter:jar:0.9.15:test
[INFO] +- com.mercateo.rest:rest-jersey-utils:jar:0.0.25:compile
[INFO] | \- javax.el:javax.el-api:jar:3.0.0:compile
[INFO] +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
[INFO] +- org.apache.commons:commons-collections4:jar:4.1:compile
[INFO] +- org.springframework.retry:spring-retry:jar:1.1.5.RELEASE:compile
[INFO] \- com.fasterxml.jackson.module:jackson-module-jsonSchema:jar:2.8.7:test
[INFO] \- javax.validation:validation-api:jar:1.1.0.Final:compile
As you can see, httpclient
version is 4.5.6.
Anything else, you can suggest to me?
Hi I recently went from preview-10 to preview-12 for
At first had a package path change error: object SdkIterable is not a member of package software.amazon.awssdk.core.pagination val iterable: SdkIterable[S3Object] = listObjectsV2Iterable.contents() Looks like something broke again
colin-williams @colin-williams 14:15
After fixing the import path to import software.amazon.awssdk.core.pagination.sync.SdkIterable then I'm getting the exception:
S3UtilTest Time elapsed: 1.823 s <<< ERROR!
java.lang.BootstrapMethodError: call site initialization exception
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
Caused by: java.lang.invoke.LambdaConversionException: Invalid receiver type interface org.apache.http.Header; not a subtype of implementation type interface org.apache.http.NameValuePair
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
Looks like the suggestion to import http-client resolved the issue:
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.5</version>
</dependency>
For some reason I thought that amazon provided shaded versions of the dependencies so these types of conflicts don't occur, but maybe that's not the case here...
Hi.
I run in the same Issue. Use "preview-13" and getting this error.
After import/using "httpclient" version 4.5.6 in maven file it works correct. Version 4.5.5 works too.
Strange behaviour...
I'm seeing this on v2.3.1 of the SDK. Just switched from 2.2.x.
Importing httpclient 4.5.6 in my Gradle project fixes this. Even more strange is that this only breaks in my debugger, not when I run a fat JAR of the same project.
I am seeing this issue while i try to get list of s3 buckets. Even importing httpclient 4.5.6 does not resolve the issue.
Stack Trace
java.lang.BootstrapMethodError: call site initialization exception at java.lang.invoke.CallSite.makeSite(CallSite.java:341) at java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:307) at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:297) at software.amazon.awssdk.http.apache.ApacheHttpClient.transformHeaders(ApacheHttpClient.java:243) at software.amazon.awssdk.http.apache.ApacheHttpClient.createResponse(ApacheHttpClient.java:228) at software.amazon.awssdk.http.apache.ApacheHttpClient.execute(ApacheHttpClient.java:208) at software.amazon.awssdk.http.apache.ApacheHttpClient.access$500(ApacheHttpClient.java:95) at software.amazon.awssdk.http.apache.ApacheHttpClient$1.call(ApacheHttpClient.java:188) at software.amazon.awssdk.core.internal.http.pipeline.stages.MakeHttpRequestStage.executeHttpRequest(MakeHttpRequestStage.java:66) at software.amazon.awssdk.core.internal.http.pipeline.stages.MakeHttpRequestStage.execute(MakeHttpRequestStage.java:51) at software.amazon.awssdk.core.internal.http.pipeline.stages.MakeHttpRequestStage.execute(MakeHttpRequestStage.java:35) at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:205) at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:205) at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:205) at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:205) at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:63) at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:36) at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:77) at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:39) at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage$RetryExecutor.doExecute(RetryableStage.java:115) at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage$RetryExecutor.execute(RetryableStage.java:88) at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:64) at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:44) at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:205) at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:51) at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:33) at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.executeWithTimer(ApiCallTimeoutTrackingStage.java:79) at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:60) at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:42) at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:205) at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:205) at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:37) at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:26) at software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient$RequestExecutionBuilderImpl.execute(AmazonSyncHttpClient.java:240) at software.amazon.awssdk.core.client.handler.BaseSyncClientHandler.invoke(BaseSyncClientHandler.java:96) at software.amazon.awssdk.core.client.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:120) at software.amazon.awssdk.core.client.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:73) at software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:44) at software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:55) at software.amazon.awssdk.services.s3.DefaultS3Client.listBuckets(DefaultS3Client.java:2029) at software.amazon.awssdk.services.s3.S3Client.listBuckets(S3Client.java:3295) at com.tpt.log_archiver.S3FileArchiver.archiveFiles(S3FileArchiver.java:35) at com.tpt.log_archiver.LogFilePoller.poll(Unknown Source) at com.tpt.log_archiver.LogFilePoller.poll(Unknown Source) at com.tpt.log_archiver.directory_poller.DirectoryPoller.lambda$registerPoller$2(DirectoryPoller.java:99) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.invoke.LambdaConversionException: Invalid receiver type interface org.apache.http.Header; not a subtype of implementation type interface org.apache.http.NameValuePair at java.lang.invoke.AbstractValidatingLambdaMetafactory.validateMetafactoryArgs(AbstractValidatingLambdaMetafactory.java:233) at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:303) at java.lang.invoke.CallSite.makeSite(CallSite.java:302) ... 45 more
I am getting the same error. Even with 4.5.5 and 4.5.6 on AWS-SDK v2.3.6 nothing works
Getting same error with httpclient 4.5.6 with AWS SDK v2.4.0 using S3Client listBuckets:
at software.amazon.awssdk.services.s3.S3Client.listBuckets(S3Client.java:3295)
at com.jenkins.plugin.aws.product.connection.AWSConnection.listBuckets(AWSConnection.java:282)
at com.jenkins.plugin.aws.product.util.FormUtils.getBucketListBox(FormUtils.java:60)
at com.jenkins.plugin.aws.product.builder.AWSProductBuildStep$DescriptorImpl.doFillProductBucketItems(AWSProductBuildStep.java:452)
at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
... 64 more
Caused by: java.lang.invoke.LambdaConversionException: Invalid receiver type interface org.apache.http.Header; not a subtype of implementation type interface org.apache.http.NameValuePair
at java.lang.invoke.AbstractValidatingLambdaMetafactory.validateMetafactoryArgs(AbstractValidatingLambdaMetafactory.java:233)
at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:303)
at java.lang.invoke.CallSite.makeSite(CallSite.java:302)
... 109 more
Make sure you use the BOM when you are working with AWS SDK. I run into similar issues before and using the correct BOM usually fixed it.
For example:
`
</dependencyManagement>`
I'm also having this issue and worked around it by adding explicitly a dependency on software.amazon.awssdk:apache-client
in my POM.
<project>
[...]
<dependencies>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>apache-client</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>sts</artifactId>
</dependency>
[...]
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.3.6</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
@mguillet Tried this out with no luck. I do have deps in httpcomponents to resolve dependency conflicts for my project:
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.10</version>
</dependency>
Just wanted to note that I have also experienced this issue with the following dependencies:
@tahoward have you tried to move higher in your dependency chain the artifact software.amazon.awssdk:apache-client
?
i had this exact error with ....s3.paginators.ListObjectsV2Iterable#contents
; fixed it by adding
<exclusions>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
</exclusion>
</exclusions>
to the dependency that was pulling in org.apache.httpcomponents:httpclient:4.5
and org.apache.httpcomponents:httpmime:4.5
and replacing them with
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>LATEST</version>
</dependency>
(currently only importing software.amazon.awssdk:s3:2.4.11 from the AWS-SDK family). fixed the problem immediately.
The problem can be fixed forcing
From 4.4.9 changelog
The problem can be fixed forcing
org.apache.httpcomponents httpcore 4.4.9
From 4.4.9 changelog
* HTTPCORE-499: Make interface Header extend NameValuePair.
Thanks it worked
Still seeing this issue with 2.5.37 no luck with the specific httpcore 4.4.9 pull in.
Still seeing this issue with 2.5.37 no luck with the specific httpcore 4.4.9 pull in.
I'm using httpclient 4.5.7 and httpcore 4.4.11 and it works perfectly but is supposed to work from httpcore 4.4.9. The fact that you are still experiencing the issue makes me wonder if you are still deploying an old version of httpcore together with the 4.4.9 so that the run-time is still piking the old one and keep throwing the exception. I can't see any other valid reason. If the run-time pick-up the correct version can't give this exception anymore, by definition, because from 4.4.9 Header is subtype of NameValuePair
Is there any particular reason that the sdk doesn't declare a dependency on the range of httpcore versions that it relies on (in their pom)? Then maven dependency management would just download the highest version that otherwise works with a user's project (or error out if no common version exists between what I specify in my pom for my project's other needs and the version range supported by the aws sdk). If my project doesn't otherwise rely on httpcore, there's no conflict, and Maven would just include the latest httpcore in the version range specified by the aws sdk.
I've never actually done something like that, so maybe there's a reason why that's not possible. But I thought Maven supported version ranges for cases like this.
I feel like consumers of the sdk shouldn't have to deal with this.
I ran into this issue with software.amazon.awssdk:bom:2.5.51
using software.amazon.awssdk:ssm
. I wasn't able to resolve it using the exclusion and explicit dependencies described above.
I was able to resolve it by making awssdk
first in my <dependencies>
section. I was then able to remove the exclusions and explicit dependencies.
forcing 4.4.9 worked for me
Still having this issue with software.amazon.awssdk:bom:2.5.51
using software.amazon.awssdk:s3
.
And even using org.apache.httpcomponents:httpclient:4.5.6
and org.apache.httpcomponents:httpcore:4.4.10
still not work...
If your code is throwing this exception you are probably deploying an older version of http client, coming transitively from some other dependency, together with the new one and the run-time is picking the old one. If you have only the http-core 4.4.9 or later version in your distribution file is impossible to rise this exception. Check your distribution file, .war or .jar, to be sure that only the correct version of http-core is in there. As said in a previous comment in 4.9.9 and later versions org.apache.http.Header implements the interface org.apache.http.NameValuePair and this excludes the possibility to rise this exception.
Il giorno mer 29 mag 2019 alle ore 12:18 cam-masai notifications@github.com ha scritto:
Still having this issue with software.amazon.awssdk:bom:2.5.51 using software.amazon.awssdk:s3. And even using org.apache.httpcomponents:httpclient:4.5.6 and org.apache.httpcomponents:httpcore:4.4.10 still not work...
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aws/aws-sdk-java-v2/issues/652?email_source=notifications&email_token=ABKV365BITZVKS3FQQ5UJ3DPXZJ53A5CNFSM4FOQG662YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWO32II#issuecomment-496876833, or mute the thread https://github.com/notifications/unsubscribe-auth/ABKV362P5NZHW6XDFYWC7TLPXZJ53ANCNFSM4FOQG66Q .
Anybody got it solved?? Still facing the same problem even after adding dependency to below artifacts software.amazon.awssdk - 2.9.16 software.amazon.awssdk - sts - 2.9.16 org.apache.httpcomponents - httpclient - 4.5.10 org.apache.httpcomponents - httpcore - 4.4.12
My pom file has no other dependency to httpcomponents.
I am trying to use STS service for on boarding and I get LambdaConversionException @resolveCredentials
StsClient stsClient = StsClient.builder().credentialsProvider(sp_StaticCredentialsProvider).build();
StsAssumeRoleCredentialsProvider assumeRoleCredentialProvider =
StsAssumeRoleCredentialsProvider.builder()
.stsClient(stsClient)
.refreshRequest(assumeRoleRequest)
.build();
AwsCredentials clientCredentials = assumeRoleCredentialProvider.resolveCredentials();
My previous answers gives the definitive solution to this problem. Step to fix it once and for all
2019-12-20 03:51:12.488 WARN 29453 --- [nio-8271-exec-1] s.a.a.h.a.internal.utils.ApacheUtils : NoSuchMethodException was thrown when disabling normalizeUri. This indicates you are using an old version (< 4.5.8) of Apache http client. It is recommended to use http client version >= 4.5.9 to avoid the breaking change introduced in apache client 4.5.7 and the latency in exception handling. See https://github.com/aws/aws-sdk-java/issues/1919 for more information
Hi @alxgrk, this has been quiet for a while now, have you got it working?
Is anyone still experiencing this issue?
If so, check your environment for conflicting versions of httpclient by running mvn dependency:tree
. Reach out if you have further questions.
Hey @debora-ito, unfortunately i've never got it working... I don't even remember in detail, but i think i just used a totally different approach to solve my problem.
From my side, this issue can be closed, since there are some suggested solutions.
Closing this, feel free to reopen if any further questions come up.
hi, i would like to re-open this issue, as we are encountering the same issue even after trying with all the above suggestions. the concerned aws support engineer suggested to reopen this case, i will upload the screen shots & errors in couple of hours.
I'm also experiencing this issue when using version 2.13.29
utilizing the dynamodb
and the dynamodb-enhanced
packages.
Fails:
<!-- AWS Only pull in the Dynamo library-->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>dynamodb</artifactId>
<version>2.13.29</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>dynamodb-enhanced</artifactId>
<version>2.13.29</version>
</dependency>
Running mvn dependency:tree
, I am given this output for my dependencies
+- software.amazon.awssdk:dynamodb:jar:2.13.29:compile
[INFO] | +- software.amazon.awssdk:aws-json-protocol:jar:2.11.14:compile
[INFO] | +- software.amazon.awssdk:protocol-core:jar:2.11.14:compile
[INFO] | +- software.amazon.awssdk:profiles:jar:2.11.14:compile
[INFO] | +- software.amazon.awssdk:sdk-core:jar:2.11.14:compile
[INFO] | +- software.amazon.awssdk:auth:jar:2.11.14:compile
[INFO] | | \- software.amazon.eventstream:eventstream:jar:1.0.1:compile
[INFO] | +- software.amazon.awssdk:http-client-spi:jar:2.11.14:compile
[INFO] | +- software.amazon.awssdk:regions:jar:2.11.14:compile
[INFO] | +- software.amazon.awssdk:annotations:jar:2.11.14:compile
[INFO] | +- software.amazon.awssdk:utils:jar:2.11.14:compile
[INFO] | +- software.amazon.awssdk:aws-core:jar:2.11.14:compile
[INFO] | +- software.amazon.awssdk:apache-client:jar:2.11.14:runtime
[INFO] | | +- org.apache.httpcomponents:httpclient:jar:4.5.10:runtime
Overriding to 4.4.9 as suggested resolves the issue.
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>dynamodb</artifactId>
<version>2.13.29</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>dynamodb-enhanced</artifactId>
<version>2.13.29</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.9</version>
</dependency>
My previous answers gives the definitive solution to this problem. Step to fix it once and for all
- Move http-core 4.4.9 or later version
- Prevent any transitive dependency on http-core versions
- Check your distribution file, .war or .jar, to be sure that only the correct version of http-core is in there. If all these steps have been done, no way to get this error any more Why we need previous steps? In 4.9.9 and later versions org.apache.http.Header implements the interface org.apache.http.NameValuePair and this excludes the possibility to rise this exception.
it worked
I tried many times and found that it was a jar package conflict
same error. Any workaround? Thanks
software.amazon.awssdk - sts - 2.16.83
org.apache.httpcomponents - httpclient - 4.5.13
org.apache.httpcomponents - httpcore - 4.4.13
WARN software.amazon.awssdk.http.apache.internal.utils.ApacheUtils - NoSuchMethodException was thrown when disabling normalizeUri. This indicates you are using an old version (< 4.5.8) of Apache http client. It is recommended to use http client version >= 4.5.9 to avoid the breaking change introduced in apache client 4.5.7 and the latency in exception handling. See https://github.com/aws/aws-sdk-java/issues/1919 for more information
...
Caused by: java.lang.invoke.LambdaConversionException: Invalid receiver type interface org.apache.http.Header; not a subtype of implementation type interface org.apache.http.NameValuePair
According to Apache change-log after 4.4.9 interface org.apache.http.Header implements interface org.apache.http.NameValuePair https://downloads.apache.org/httpcomponents/httpcore/RELEASE_NOTES-4.4.x.txt Analize your distributed JAR or WAR(open with on archive manager) and exclude that for some transitive dependency you are distributing an old version along with the ones you are mentioning
I set the version of httpcore
and httpclient
in the <dependencyManagement>
, but it didn't work.
After that, I checked my local Maven repository. I found there are many version of httpcore
and httpclient
in my local repository.
(under <pathToYourMavenRepository>\org\apache\httpcomponents\httpcore
and \httpclient
)
I removed the folder of httpcore
and httpclient
and reloaded Maven dependencies of my project.
The folder of httpcore
and httpclient
showed up, with the correct version inside.
Problem solved!!
<dependencies>
<!--AWS SDK-->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
</dependency>
</dependencies>
...
<dependencyManagement>
<dependencies>
<!-- AWS SDK Java v2-->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.17.46</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.11</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
</dependencyManagement>
Hi there,
I'm trying to use the
cloudsearchdomain
service, especially theSwitchToPostInterceptor
.Expected Behavior
Using the
CloudSearchDomainClient
, I'm trying to upload documents to an existing instance. I expect an HTTP-Response with status code 200, which should be mapped to the Java typeSearchResponse
.Current Behavior
Unfortunately, the mapping of the response to the Java type does not seem to work. The method call ends with the exception listed below:
Stacktrace:
Debug Log:
Steps to Reproduce (for bugs)
In Maven POM (among other dependencies of [aws-sdk-java|https://github.com/aws/aws-sdk-java]):
DomainClient configuration:
UploadDocument operation:
Context
As mentioned above, I'm already using the
aws-sdk-java
CloudSearch client. However, I want to take advantage of the usage of POST as HTTP-Method for every request.Your Environment
Looking forward to an answer and thanks in advance, Alex