-
Type: Task
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.11.0
-
Component/s: Authentication
-
None
-
Environment:mongodb-driver:3.11.0 intent connect to server mongo with MongoCredential.createScramSha256Credential()
I intented connect android app to mongodb with authentication SCRAM-SHA256 but when execute a find() in my collection, throw this exception:
I/cluster: Cluster created with settings
{hosts=[mymongoserver.com:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500} I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mongodb.internal.connection.ScramShaAuthenticator$ScramShaSaslClient>
Rejecting re-init on previously-failed class java.lang.Class<com.mongodb.internal.connection.ScramShaAuthenticator$ScramShaSaslClient>
I/connection: Opened connection [connectionId
] to mymongoserver.com:27017
I/cluster: Monitor thread successfully connected to server with description ServerDescription{address=mymongoserver.com:27017, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion
, minWireVersion=0, maxWireVersion=7, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=71782969}
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mongodb.internal.connection.ScramShaAuthenticator$ScramShaSaslClient>
I/connection: Closed connection [connectionId
] to mymongoserver.com:27017 because there was a socket exception raised by this connection.
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
PD: I using org.mongodb:mongodb-driver:3.11.0 and a MongoCollection<BasicDBObject>
Thanks for you attention
- is duplicated by
-
JAVA-3424 ¿Puedo conectar una aplicación a mongodb con authenticación SCRAM-SHA256?
- Closed