[ https://issues.apache.org/jira/browse/SLING-10402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17348648#comment-17348648 ]
Eric Norman edited comment on SLING-10402 at 5/20/21, 5:42 PM: --------------------------------------------------------------- [~rombert] I suppose we could hardcode a specific version for mongo-java-driver in the maven-version-rules.xml of org-apache-sling-build-version-rules if oak requires a specific version of the mongo-java-driver and no other version is expected to work, but is that really the case here? I'm no expert on the mongo-java-driver, but can someone explain to me what the root of the problem is here? It seems to me that the version in the oak parent pom should be just the minimum version, so newer compatible versions of mongo-java-driver should reasonably be expected to work in the runtime as well. And from what I have just read on [https://docs.mongodb.com/drivers/java/] it says that the mongo-java-driver version 3.11 to 4.2 are supposed to be compatible with MongoDB 4.0.x and all of our supported JVM versions. Maybe OAK-9357 resolves the problems? Has anyone tried with oak a 1.40.0 snapshot? was (Author: enorman): [~rombert] I suppose we could hardcode a specific version for mongo-java-driver in the maven-version-rules.xml of org-apache-sling-build-version-rules if oak requires a specific version of the mongo-java-driver and no other version is expected to work, but is that really the case here? I'm no expert on the mongo-java-driver, but can someone explain to me what the root of the problem is here? It seems to me that the version in the oak parent pom should be just the minimum version, so newer compatible versions of mongo-java-driver should reasonably be expected to work in the runtime as well. And from what I have just read on [https://docs.mongodb.com/drivers/java/] it says that the mongo-java-driver version 3.11 to 4.2 are supposed to be compatible with MongoDB 4.0.x and all of our supported JVM versions. > MongoDB doesn't work anymore with Sling Starter > ----------------------------------------------- > > Key: SLING-10402 > URL: https://issues.apache.org/jira/browse/SLING-10402 > Project: Sling > Issue Type: Bug > Components: Starter > Affects Versions: Starter 12 > Environment: Sling-Starter 12-SNAPSHOT (commit a6b94beb7b) with JDK > 11 on MacOS > Reporter: Hans-Peter Stoerr > Assignee: Robert Munteanu > Priority: Major > Fix For: Starter 12 > > Time Spent: 40m > Remaining Estimate: 0h > > When starting the Sling Starter 12 SNAPSHOT with, the Repository doesn't seem > to work properly right now when I'm using MongoDB. It starts up, but when I > open http://localhost:8080/bin/browser.html, I get an exception reading from > the database (see below). I tried with mongodb 4.4.6 (the latest one) and > 4.0.3. This issue seems to be connected to the version of > org.mongodb:mongo-java-driver - it came in when it was upgraded from 3.8.2 to > 3.12.7; if I downgrade to 3.10.2 it works, but with 3.11.3, 3.12.7 or 3.12.8 > it doesn't. > {code} > Caused by: java.lang.RuntimeException: failed to read block from backend, id > 6e01a3001107903ee3971f74d9ba7e4bf6d512d47b1006b708f7ca295658fead@0 > at > org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.load(AbstractBlobStore.java:509) > at > org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.readBlock(AbstractBlobStore.java:500) > at > org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.readBlob(AbstractBlobStore.java:486) > at > org.apache.jackrabbit.oak.spi.blob.BlobStoreInputStream.read(BlobStoreInputStream.java:45) > ... 96 more > Caused by: java.lang.UnsupportedOperationException: The BsonCodec can only > encode to Bson > at org.bson.codecs.BsonCodec.decode(BsonCodec.java:48) > at org.bson.codecs.BsonCodec.decode(BsonCodec.java:33) > at > com.mongodb.operation.CommandResultArrayCodec.decode(CommandResultArrayCodec.java:52) > at > com.mongodb.operation.CommandResultDocumentCodec.readValue(CommandResultDocumentCodec.java:60) > at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:84) > at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:41) > at org.bson.codecs.configuration.LazyCodec.decode(LazyCodec.java:47) > at > org.bson.codecs.BsonDocumentCodec.readValue(BsonDocumentCodec.java:101) > at > com.mongodb.operation.CommandResultDocumentCodec.readValue(CommandResultDocumentCodec.java:63) > at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:84) > at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:41) > at > com.mongodb.internal.connection.ReplyMessage.<init>(ReplyMessage.java:51) > at > com.mongodb.internal.connection.InternalStreamConnection.getCommandResult(InternalStreamConnection.java:413) > at > com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:309) > at > com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:259) > at > com.mongodb.internal.connection.UsageTrackingInternalConnection.sendAndReceive(UsageTrackingInternalConnection.java:99) > at > com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.sendAndReceive(DefaultConnectionPool.java:450) > at > com.mongodb.internal.connection.CommandProtocolImpl.execute(CommandProtocolImpl.java:72) > at > com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:218) > at > com.mongodb.internal.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:269) > at > com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:131) > at > com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:123) > at > com.mongodb.operation.CommandOperationHelper.executeCommand(CommandOperationHelper.java:343) > at > com.mongodb.operation.CommandOperationHelper.executeCommand(CommandOperationHelper.java:334) > at > com.mongodb.operation.CommandOperationHelper.executeCommandWithConnection(CommandOperationHelper.java:220) > at com.mongodb.operation.FindOperation$1.call(FindOperation.java:731) > 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 > org.apache.jackrabbit.oak.plugins.document.mongo.MongoBlobStore.getBlob(MongoBlobStore.java:234) > at > org.apache.jackrabbit.oak.plugins.document.mongo.MongoBlobStore.readBlockFromBackend(MongoBlobStore.java:153) > at > org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.load(AbstractBlobStore.java:507) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)