开发者社区> 问答> 正文

java链接mongodb出现异常MongoTimeoutException,求破

mongodb操作时出现异常信息如下:

Caused by: com.mongodb.MongoTimeoutException: Timeout waiting for a pooled item after 5000 MILLISECONDS
    at com.mongodb.internal.connection.ConcurrentPool.get(ConcurrentPool.java:127)
    at com.mongodb.connection.DefaultConnectionPool.getPooledConnection(DefaultConnectionPool.java:256)
    at com.mongodb.connection.DefaultConnectionPool.get(DefaultConnectionPool.java:97)
    at com.mongodb.connection.DefaultConnectionPool.get(DefaultConnectionPool.java:86)
    at com.mongodb.connection.DefaultServer.getConnection(DefaultServer.java:77)
    at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.getConnection(ClusterBinding.java:86)
    at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:431)
    at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:406)
    at com.mongodb.operation.FindOperation.execute(FindOperation.java:709)
    at com.mongodb.operation.FindOperation.execute(FindOperation.java:81)
    at com.mongodb.Mongo.execute(Mongo.java:810)
    at com.mongodb.Mongo$2.execute(Mongo.java:797)
    at com.mongodb.DBCursor.initializeCursor(DBCursor.java:871)
    at com.mongodb.DBCursor.hasNext(DBCursor.java:142)
    at com.mongodb.DBCursor.one(DBCursor.java:680)
    at com.mongodb.DBCollection.findOne(DBCollection.java:831)
    at com.mongodb.DBCollection.findOne(DBCollection.java:794)
    at com.mongodb.DBCollection.findOne(DBCollection.java:741)
    at org.springframework.data.mongodb.core.MongoTemplate$FindOneCallback.doInCollection(MongoTemplate.java:2197)
    at org.springframework.data.mongodb.core.MongoTemplate$FindOneCallback.doInCollection(MongoTemplate.java:2181)
    at org.springframework.data.mongodb.core.MongoTemplate.executeFindOneInternal(MongoTemplate.java:1925)
    ... 18 more

这是哪里配置的不对吗???

展开
收起
magicalman 2021-10-26 18:23:56 2034 0
1 条回答
写回答
取消 提交回答
  • 本人csdn 博客地址https://liuyunshengsir.blog.csdn.net/ 推荐的chatgpt地址:http://124.220.104.235/web/chatgpt

    telnet 10.0.42.211 27017 参考我的文章

    2022-11-22 16:11:30
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
开源数据库 MongoDB 专场 MongoDB疑难杂症分析及优化 立即下载
MongoDB多数据中心的方案选型之路 立即下载
饿了么高级架构师陈东明:MongoDB是如何逐步提高可靠性的 立即下载