-
Type: Task
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.11.0
-
Component/s: API
-
None
-
Environment:Implementando aplicación nativa de android (java) con driver org.mongodb:mongodb-driver:3.11.0
Estoy intentando conectarme con a mi servidor mongo (MongoClient) con autenticación de SCRAM-SHA256 (createScramSha256Credential), pero marca una excepción:
E/com.probando.app.MongoDB: MongoException ->
com.mongodb.MongoException: java.lang.NoClassDefFoundError: com.mongodb.internal.connection.ScramShaAuthenticator$ScramShaSaslClient
at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:138)
at com.mongodb.internal.connection.UsageTrackingInternalConnection.open(UsageTrackingInternalConnection.java:50)
at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.open(DefaultConnectionPool.java:398)
at com.mongodb.internal.connection.DefaultConnectionPool.get(DefaultConnectionPool.java:115)
at com.mongodb.internal.connection.DefaultConnectionPool.get(DefaultConnectionPool.java:101)
at com.mongodb.internal.connection.DefaultServer.getConnection(DefaultServer.java:92)
at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.getConnection(ClusterBinding.java:126)
at com.mongodb.operation.FindOperation$1.call(FindOperation.java:728)
at com.mongodb.operation.FindOperation$1.call(FindOperation.java:725)
at com.mongodb.operation.OperationHelper.withReadConnectionSource(OperationHelper.java:463)
at com.mongodb.operation.FindOperation.execute(FindOperation.java:725)
at com.mongodb.operation.FindOperation.execute(FindOperation.java:89)
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:189)
at com.mongodb.client.internal.MongoIterableImpl.execute(MongoIterableImpl.java:143)
at com.mongodb.client.internal.MongoIterableImpl.iterator(MongoIterableImpl.java:92)
at com.mongodb.client.internal.MongoIterableImpl.forEach(MongoIterableImpl.java:121)
at com.mongodb.client.internal.MongoIterableImpl.into(MongoIterableImpl.java:133)
at com.probando.app.MongoDB.GetDocumentos(MongoDB.java:129)
at com.probando.app.MongoActivity$GetDocumentos.doInBackground(MongoActivity.java:58)
at com.probando.app.MongoActivity$GetDocumentos.doInBackground(MongoActivity.java:54)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NoClassDefFoundError: com.mongodb.internal.connection.ScramShaAuthenticator$ScramShaSaslClient
at com.mongodb.internal.connection.ScramShaAuthenticator.createSaslClient(ScramShaAuthenticator.java:77)
at com.mongodb.internal.connection.SaslAuthenticator$1.run(SaslAuthenticator.java:50)
at com.mongodb.internal.connection.SaslAuthenticator$1.run(SaslAuthenticator.java:47)
at com.mongodb.internal.connection.SaslAuthenticator.doAsSubject(SaslAuthenticator.java:179)
at com.mongodb.internal.connection.SaslAuthenticator.authenticate(SaslAuthenticator.java:47)
at com.mongodb.internal.connection.InternalStreamConnectionInitializer.authenticateAll(InternalStreamConnectionInitializer.java:156)
at com.mongodb.internal.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:63)
at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:129)
at com.mongodb.internal.connection.UsageTrackingInternalConnection.open(UsageTrackingInternalConnection.java:50)
at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.open(DefaultConnectionPool.java:398)
at com.mongodb.internal.connection.DefaultConnectionPool.get(DefaultConnectionPool.java:115)
at com.mongodb.internal.connection.DefaultConnectionPool.get(DefaultConnectionPool.java:101)
at com.mongodb.internal.connection.DefaultServer.getConnection(DefaultServer.java:92)
at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.getConnection(ClusterBinding.java:126)
at com.mongodb.operation.FindOperation$1.call(FindOperation.java:728)
at com.mongodb.operation.FindOperation$1.call(FindOperation.java:725)
at com.mongodb.operation.OperationHelper.withReadConnectionSource(OperationHelper.java:463)
at com.mongodb.operation.FindOperation.execute(FindOperation.java:725)
at com.mongodb.operation.FindOperation.execute(FindOperation.java:89)
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:189)
at com.mongodb.client.internal.MongoIterableImpl.execute(MongoIterableImpl.java:143)
at com.mongodb.client.internal.MongoIterableImpl.iterator(MongoIterableImpl.java:92)
at com.mongodb.client.internal.MongoIterableImpl.forEach(MongoIterableImpl.java:121)
at com.mongodb.client.internal.MongoIterableImpl.into(MongoIterableImpl.java:133)
at com.probando.app.MongoDB.GetDocumentos(MongoDB.java:129)
at com.probando.app.MongoActivity$GetDocumentos.doInBackground(MongoActivity.java:58)
at com.probando.app.MongoActivity$GetDocumentos.doInBackground(MongoActivity.java:54)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
I/cluster: Cluster created with settings
Pero el error ocurre cuando intento hacer una búsqueda en mi colección, lo cual no entiendo porque y antes de mostrar el error me marca que la conexión se establecio (por o que entiendo):
I/cluster: Monitor thread successfully connected to server with description ServerDescription{address=myserver.com:27017, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion
{versionList=[4, 0, 9]}, minWireVersion=0, maxWireVersion=7, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=76710156}
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mongodb.internal.connection.ScramShaAuthenticator$ScramShaSaslClient>
I/connection: Closed connection [connectionId
] to myserver.com:27017 because there was a socket exception raised by this connection.
- duplicates
-
JAVA-3423 Authenticate Java Driver credential SCRAM-SHA256
- Closed