Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-10402

MongoDB doesn't work anymore with Sling Starter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Starter 12
    • Starter 12
    • Starter
    • None
    •  Sling-Starter 12-SNAPSHOT (commit a6b94beb7b) with JDK 11 on MacOS

    Description

      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.

      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)
      

      Attachments

        Issue Links

          Activity

            People

              rombert Robert Munteanu
              hanspeterstoerr Hans-Peter Stoerr
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h 40m
                  3h 40m