Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Error about missing AWS Auth class #32

Open
nikosszzz opened this issue Nov 6, 2023 · 1 comment
Open

Error about missing AWS Auth class #32

nikosszzz opened this issue Nov 6, 2023 · 1 comment

Comments

@nikosszzz
Copy link

nikosszzz commented Nov 6, 2023

Hello, I've been making a small test hobby app using this library to access Mongo for testing and this error popped out of nowhere:

Missing class com.amazonaws.auth.AWSCredentialsProvider (referenced from: com.amazonaws.auth.AWSCredentialsProvider com.mongodb.internal.authentication.AwsSdkV1CredentialSupplier.provider and 1 other context)
Missing class com.amazonaws.auth.AWSSessionCredentials (referenced from: com.mongodb.AwsCredential com.mongodb.internal.authentication.AwsSdkV1CredentialSupplier.get())
Missing class com.amazonaws.auth.DefaultAWSCredentialsProviderChain (referenced from: void com.mongodb.internal.authentication.AwsSdkV1CredentialSupplier.<init>())
Missing class com.github.luben.zstd.Zstd (referenced from: void com.mongodb.internal.connection.ZstdCompressor.compress(java.util.List, org.bson.io.BsonOutput))
Missing class com.github.luben.zstd.ZstdInputStream (referenced from: java.io.InputStream com.mongodb.internal.connection.ZstdCompressor.getInputStream(java.io.InputStream))
Missing class com.mongodb.crypt.capi.MongoCrypt (referenced from: com.mongodb.crypt.capi.MongoCrypt com.mongodb.reactivestreams.client.internal.crypt.Crypt.mongoCrypt and 6 other contexts)
Missing class com.mongodb.crypt.capi.MongoCryptContext$State (referenced from: void com.mongodb.reactivestreams.client.internal.crypt.Crypt$1.<clinit>() and 1 other context)
Missing class com.mongodb.crypt.capi.MongoCryptContext (referenced from: void com.mongodb.reactivestreams.client.internal.crypt.Crypt.collInfo(com.mongodb.crypt.capi.MongoCryptContext, java.lang.String, reactor.core.publisher.MonoSink) and 17 other contexts)
Missing class com.mongodb.crypt.capi.MongoCryptException (referenced from: reactor.core.publisher.Mono com.mongodb.reactivestreams.client.internal.crypt.Crypt.executeStateMachine(java.util.function.Supplier, java.lang.String))
Missing class com.mongodb.crypt.capi.MongoCryptOptions$Builder (referenced from: com.mongodb.crypt.capi.MongoCryptOptions com.mongodb.internal.capi.MongoCryptHelper.createMongoCryptOptions(java.util.Map, boolean, java.util.List, java.util.Map, java.util.Map, java.util.Map))
Missing class com.mongodb.crypt.capi.MongoCryptOptions (referenced from: com.mongodb.crypt.capi.MongoCryptOptions com.mongodb.internal.capi.MongoCryptHelper.createMongoCryptOptions(com.mongodb.AutoEncryptionSettings) and 2 other contexts)
Missing class com.mongodb.crypt.capi.MongoCrypts (referenced from: com.mongodb.reactivestreams.client.internal.crypt.Crypt com.mongodb.reactivestreams.client.internal.crypt.Crypts.createCrypt(com.mongodb.reactivestreams.client.internal.MongoClientImpl, com.mongodb.AutoEncryptionSettings))
Missing class com.mongodb.crypt.capi.MongoKeyDecryptor (referenced from: com.mongodb.crypt.capi.MongoKeyDecryptor com.mongodb.reactivestreams.client.internal.crypt.KeyManagementService$1.val$keyDecryptor and 15 other contexts)
Missing class io.micrometer.context.ContextAccessor (referenced from: reactor.util.context.ReactorContextAccessor)
Missing class javax.naming.NameNotFoundException (referenced from: java.util.List com.mongodb.internal.dns.JndiDnsClient.getResourceRecordData(java.lang.String, java.lang.String))
Missing class javax.naming.NamingEnumeration (referenced from: java.util.List com.mongodb.internal.dns.JndiDnsClient.getResourceRecordData(java.lang.String, java.lang.String))
Missing class javax.naming.NamingException (referenced from: javax.naming.directory.InitialDirContext com.mongodb.internal.dns.JndiDnsClient.createDnsDirContext() and 1 other context)
Missing class javax.naming.directory.Attribute (referenced from: java.util.List com.mongodb.internal.dns.JndiDnsClient.getResourceRecordData(java.lang.String, java.lang.String))
Missing class javax.naming.directory.Attributes (referenced from: java.util.List com.mongodb.internal.dns.JndiDnsClient.getResourceRecordData(java.lang.String, java.lang.String))
Missing class javax.naming.directory.InitialDirContext (referenced from: javax.naming.directory.InitialDirContext com.mongodb.internal.dns.JndiDnsClient.createDnsDirContext() and 1 other context)
Missing class javax.security.auth.callback.NameCallback (referenced from: void com.mongodb.internal.connection.PlainAuthenticator$1.handle(javax.security.auth.callback.Callback[]))
Missing class javax.security.auth.kerberos.KerberosPrincipal (referenced from: boolean com.mongodb.KerberosSubjectProvider.needNewSubject(javax.security.auth.Subject))
Missing class javax.security.auth.kerberos.KerberosTicket (referenced from: boolean com.mongodb.KerberosSubjectProvider.needNewSubject(javax.security.auth.Subject))
Missing class javax.security.auth.login.LoginContext (referenced from: javax.security.auth.Subject com.mongodb.KerberosSubjectProvider.createNewSubject())
Missing class javax.security.sasl.Sasl (referenced from: javax.security.sasl.SaslClient com.mongodb.internal.connection.GSSAPIAuthenticator.createSaslClient(com.mongodb.ServerAddress) and 1 other context)
Missing class javax.security.sasl.SaslClient (referenced from: javax.security.sasl.SaslClient com.mongodb.internal.connection.SaslAuthenticator$3.val$saslClient and 29 other contexts)
Missing class javax.security.sasl.SaslException (referenced from: javax.security.sasl.SaslClient com.mongodb.internal.connection.GSSAPIAuthenticator.createSaslClient(com.mongodb.ServerAddress) and 4 other contexts)
Missing class org.ietf.jgss.GSSCredential (referenced from: javax.security.sasl.SaslClient com.mongodb.internal.connection.GSSAPIAuthenticator.createSaslClient(com.mongodb.ServerAddress) and 1 other context)
Missing class org.ietf.jgss.GSSException (referenced from: javax.security.sasl.SaslClient com.mongodb.internal.connection.GSSAPIAuthenticator.createSaslClient(com.mongodb.ServerAddress))
Missing class org.ietf.jgss.GSSManager (referenced from: org.ietf.jgss.GSSCredential com.mongodb.internal.connection.GSSAPIAuthenticator.getGSSCredential(java.lang.String))
Missing class org.ietf.jgss.GSSName (referenced from: org.ietf.jgss.GSSCredential com.mongodb.internal.connection.GSSAPIAuthenticator.getGSSCredential(java.lang.String))
Missing class org.ietf.jgss.Oid (referenced from: org.ietf.jgss.GSSCredential com.mongodb.internal.connection.GSSAPIAuthenticator.getGSSCredential(java.lang.String))
Missing class org.slf4j.Logger (referenced from: org.slf4j.Logger com.mongodb.internal.diagnostics.logging.SLF4JLogger.delegate and 27 other contexts)
Missing class org.slf4j.LoggerFactory (referenced from: void com.mongodb.internal.diagnostics.logging.SLF4JLogger.<init>(java.lang.String) and 2 other contexts)
Missing class org.xerial.snappy.Snappy (referenced from: void com.mongodb.internal.connection.SnappyCompressor.compress(java.util.List, org.bson.io.BsonOutput))
Missing class org.xerial.snappy.SnappyInputStream (referenced from: java.io.InputStream com.mongodb.internal.connection.SnappyCompressor.getInputStream(java.io.InputStream))
Missing class reactor.blockhound.integration.BlockHoundIntegration (referenced from: reactor.core.scheduler.ReactorBlockHoundIntegration)
Missing class software.amazon.awssdk.auth.credentials.AwsCredentials (referenced from: com.mongodb.AwsCredential com.mongodb.internal.authentication.AwsSdkV2CredentialSupplier.get())
Missing class software.amazon.awssdk.auth.credentials.AwsCredentialsProvider (referenced from: software.amazon.awssdk.auth.credentials.AwsCredentialsProvider com.mongodb.internal.authentication.AwsSdkV2CredentialSupplier.provider and 1 other context)
Missing class software.amazon.awssdk.auth.credentials.AwsSessionCredentials (referenced from: com.mongodb.AwsCredential com.mongodb.internal.authentication.AwsSdkV2CredentialSupplier.get())
Missing class software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider (referenced from: void com.mongodb.internal.authentication.AwsSdkV2CredentialSupplier.<init>())
Caused by: [CIRCULAR REFERENCE: com.android.tools.r8.utils.b: Missing class com.amazonaws.auth.AWSCredentials (referenced from: com.mongodb.AwsCredential com.mongodb.internal.authentication.AwsSdkV1CredentialSupplier.get())

I tried resetting my gradle cache to redownload all the dependencies, but its still happening.

@lsafer-meemer
Copy link
Collaborator

Hi, thank you for your feedback 👍️

It appears that the classpath is missing some dependencies.

Note that including this library as a dependency does NOT automatically add mongodb dependencies.

Additional context about the dependencies and the database initialization code might help solving the problem.

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

No branches or pull requests

2 participants