com.mongodb.MongoException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I've upgraded my code from morphia version 0.108 to 1.0.1. Now, when I try to connect to my local mongo db (version 3.0.4) I get the following exception: [ting-server-ws] 18:27:13 [cluster-ClusterId{value='55f98a51c811d557f2064f3f', description='null'}-127.0.0.1:27017] INFO org.mongodb.driver.cluster - Exception in monitor thread while connecting to server 127.0.0.1:27017 com.mongodb.MongoException: java.lang.IncompatibleClassChangeError: Class com.mongodb.connection.ByteBufferBsonOutput does not implement the requested interface org.bson.io.BsonOutput at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:125) ~[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:127) ~[mongo-java-driver-3.0.4.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_51] Caused by: java.lang.IncompatibleClassChangeError: Class com.mongodb.connection.ByteBufferBsonOutput does not implement the requested interface org.bson.io.BsonOutput at com.mongodb.connection.RequestMessage.encode(RequestMessage.java:130) ~[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.CommandHelper.sendMessage(CommandHelper.java:88) ~[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.CommandHelper.executeCommand(CommandHelper.java:32) ~[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:83) ~[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:43) ~[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:115) ~[mongo-java-driver-3.0.4.jar:na] ... 2 common frames omitted My code: MongoClientOptions mongoOptions = MongoClientOptions.builder().connectionsPerHost(mongoConnectionsPerHost).connectTimeout(mongoConnectTimeout) .threadsAllowedToBlockForConnectionMultiplier(mongoThreadsAllowedToBlockForConnectionMultiplier).build(); String[] addresses = mongoHosts.split(","); if (addresses == null || addresses.length == 0) { throw new BeanCreationException("At least one MongoDB address must be specified."); } ArrayList<ServerAddress> listOfAddresses = new ArrayList<ServerAddress>(); try { for (String a : addresses) { listOfAddresses.add(new ServerAddress(a, Integer.parseInt(mongoPort))); } return new MongoClient(listOfAddresses, mongoOptions); } catch (NumberFormatException | MongoException e) { throw new BeanCreationException(e.toString(), e); }
    via by Noam Dayan,
  • I've upgraded my code from morphia version 0.108 to 1.0.1. Now, when I try to connect to my local mongo db (version 3.0.4) I get the following exception: [ting-server-ws] 18:27:13 [cluster-ClusterId{value='55f98a51c811d557f2064f3f', description='null'}-127.0.0.1:27017] INFO org.mongodb.driver.cluster - Exception in monitor thread while connecting to server 127.0.0.1:27017 com.mongodb.MongoException: java.lang.IncompatibleClassChangeError: Class com.mongodb.connection.ByteBufferBsonOutput does not implement the requested interface org.bson.io.BsonOutput at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:125) ~[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:127) ~[mongo-java-driver-3.0.4.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_51] Caused by: java.lang.IncompatibleClassChangeError: Class com.mongodb.connection.ByteBufferBsonOutput does not implement the requested interface org.bson.io.BsonOutput at com.mongodb.connection.RequestMessage.encode(RequestMessage.java:130) ~[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.CommandHelper.sendMessage(CommandHelper.java:88) ~[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.CommandHelper.executeCommand(CommandHelper.java:32) ~[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:83) ~[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:43) ~[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:115) ~[mongo-java-driver-3.0.4.jar:na] ... 2 common frames omitted My code: MongoClientOptions mongoOptions = MongoClientOptions.builder().connectionsPerHost(mongoConnectionsPerHost).connectTimeout(mongoConnectTimeout) .threadsAllowedToBlockForConnectionMultiplier(mongoThreadsAllowedToBlockForConnectionMultiplier).build(); String[] addresses = mongoHosts.split(","); if (addresses == null || addresses.length == 0) { throw new BeanCreationException("At least one MongoDB address must be specified."); } ArrayList<ServerAddress> listOfAddresses = new ArrayList<ServerAddress>(); try { for (String a : addresses) { listOfAddresses.add(new ServerAddress(a, Integer.parseInt(mongoPort))); } return new MongoClient(listOfAddresses, mongoOptions); } catch (NumberFormatException | MongoException e) { throw new BeanCreationException(e.toString(), e); }
    via by Noam Dayan,
    • com.mongodb.MongoException: java.lang.IncompatibleClassChangeError: Class com.mongodb.connection.ByteBufferBsonOutput does not implement the requested interface org.bson.io.BsonOutput at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:125)[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:127)[mongo-java-driver-3.0.4.jar:na] at java.lang.Thread.run(Thread.java:745)[na:1.8.0_51] Caused by: java.lang.IncompatibleClassChangeError: Class com.mongodb.connection.ByteBufferBsonOutput does not implement the requested interface org.bson.io.BsonOutput at com.mongodb.connection.RequestMessage.encode(RequestMessage.java:130)[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.CommandHelper.sendMessage(CommandHelper.java:88)[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.CommandHelper.executeCommand(CommandHelper.java:32)[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:83)[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:43)[mongo-java-driver-3.0.4.jar:na] at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:115)[mongo-java-driver-3.0.4.jar:na] ... 2 more
    No Bugmate found.