Closed peniakoff closed 3 years ago
Problem solved. I've added two dependencies below with "compile" scope.
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.11</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.jodah</groupId>
<artifactId>failsafe</artifactId>
<version>2.4.0</version>
<scope>compile</scope>
</dependency>
AWS SAM CLI is building application based on local Maven repositories. When package is set with scope "runtime" SAM builder doesn't use it during building process and finally this package is not located in runtime. Maybe could you move these packages to the "compile" scope for the future?
Today the 3.1.0 has been released and this now declares also all runtime dependencies with api scope in the gradle file. Which will translate to compile scope in the pom file
Thanks @jenschude!
With SDK v3.1.0 problem was solved! :+1:
I'm trying to run Commercetools client based on the Micronaut function (for AWS Lambda purposes). I'm using Micronaut core v2.3.1. It is importatnt because when I try to connect to the Commercetools without Micronaut stuff, everything works fine. But now method
constructApiHttpRequest
(classio.vrap.rmf.base.client.oauth2.ClientCredentialsTokenSupplier#constructApiHttpRequest
) can not buildnew ApiHttpRequest(ApiHttpMethod.POST, URI.create(tokenEndpoint), headers, body.getBytes(StandardCharsets.UTF_8))
because of exceptionMethod threw 'java.lang.NoClassDefFoundError' exception. Cannot evaluate io.vrap.rmf.base.client.ApiHttpRequest.toString()
. But I can not investigate where basically there is any sub-method which usestoString()
on the ApiHttpRequest.In the stack tree we can find also:
net/jodah/failsafe/Policy: java.lang.NoClassDefFoundError java.lang.NoClassDefFoundError: net/jodah/failsafe/Policy at io.vrap.rmf.base.client.MiddlewareFactory.createDefault(MiddlewareFactory.java:23) at io.vrap.rmf.base.client.ClientFactory.create(ClientFactory.java:85) at io.vrap.rmf.base.client.ClientFactory.create(ClientFactory.java:76) at com.commercetools.api.defaultconfig.ApiFactory.defaultClient(ApiFactory.java:158) at com.commercetools.api.defaultconfig.ApiFactory.lambda$create$6(ApiFactory.java:57) at com.commercetools.api.defaultconfig.ApiFactory.create(ApiFactory.java:106) at com.commercetools.api.defaultconfig.ApiFactory.create(ApiFactory.java:57)
Package net.jodah.failsafe (in version 2.4.0) is localized ofc in my dependencies tree.
Expected behavior Possibiity to use CT Java SDK with Micronaut framework.
Desktop (please complete the following information):