Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localstack-v2 require aws sdk 1.x and 2.x #234

Open
rpiotrow opened this issue Aug 11, 2022 · 2 comments
Open

localstack-v2 require aws sdk 1.x and 2.x #234

rpiotrow opened this issue Aug 11, 2022 · 2 comments

Comments

@rpiotrow
Copy link

rpiotrow commented Aug 11, 2022

If we define test-containers-localstack-v2-aws-only2.sc as:

using lib "software.amazon.awssdk:auth:2.17.250"
using lib "com.dimafeng::testcontainers-scala-localstack-v2:0.40.10"

import com.dimafeng.testcontainers.LocalStackV2Container

LocalStackV2Container()

then there is compile error:

$ scala-cli test-containers-localstack-v2-aws-only2.sc
Exception in thread "main" java.lang.NoClassDefFoundError: com/amazonaws/auth/AWSCredentials
	at com.dimafeng.testcontainers.LocalStackV2Container.<init>(LocalStackV2Container.scala:14)
	at com.dimafeng.testcontainers.LocalStackV2Container$.apply(LocalStackV2Container.scala:8)
	at test$minuscontainers$minusscala$minusissue$.<clinit>(test-containers-scala-issue.sc:8)
	at test$minuscontainers$minusscala$minusissue_sc$.main(test-containers-scala-issue.sc:25)
	at test$minuscontainers$minusscala$minusissue_sc.main(test-containers-scala-issue.sc)
Caused by: java.lang.ClassNotFoundException: com.amazonaws.auth.AWSCredentials
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 5 more

When we add dependency to aws 1.x (making test-containers-localstack-v2-aws-1-and-2.sc):

using lib "software.amazon.awssdk:auth:2.17.250"
using lib "com.dimafeng::testcontainers-scala-localstack-v2:0.40.10"

using lib "com.amazonaws:aws-java-sdk-core:1.12.93"

import com.dimafeng.testcontainers.LocalStackV2Container

LocalStackV2Container()

it will compile:

$ scala-cli test-containers-localstack-v2-aws-1-and-2.sc
Compiling project (Scala 3.1.3, JVM)
Compiled project (Scala 3.1.3, JVM)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

It is not very intuitive that testcontainers-scala-localstack-v2 requires both AWS sdk major versions to work and I didn't find any information about that.

@dbuschman7
Copy link

+1

1 similar comment
@skyrylyuk
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants