项目连接数据库、redis、mongodb隔一会就报错处理

本地项目报了下面的错误,但是测试环境使用同样的配置没有问题,网上试了各种方法都不行,最后,在本地安装一份mysql、redis、mongodb,供本地使用,不连接阿里云的数据库,错误消失
redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out
at redis.clients.jedis.util.RedisInputStream.ensureFill(RedisInputStream.java:205)
at redis.clients.jedis.util.RedisInputStream.readByte(RedisInputStream.java:43)
at redis.clients.jedis.Protocol.process(Protocol.java:154)
at redis.clients.jedis.Protocol.read(Protocol.java:219)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:309)
at redis.clients.jedis.Connection.getBinaryMultiBulkReply(Connection.java:270)
at redis.clients.jedis.Connection.getMultiBulkReply(Connection.java:264)
at redis.clients.jedis.Jedis.smembers(Jedis.java:1228)
at com.game.loginsr.manager.ServerManager.backServersShowInfo(ServerManager.java:143)
at com.game.loginsr.manager.ServerManager.buildServerInfo(ServerManager.java:128)
at com.game.scripts.login.LoginScript.buildServerInfo(LoginScript.java:186)
at com.game.scripts.login.LoginScript.getGameList(LoginScript.java:158)
at com.game.scripts.login.LoginScript.login(LoginScript.java:123)
at com.game.handler.tcp.login.Login_ReqTokenLoginHandler.lambda$run 0 ( L o g i n R e q T o k e n L o g i n H a n d l e r . j a v a : 39 ) a t c o m . g a m e . e n g i n e . s c r i p t . S c r i p t L o a d e r . l a m b d a 0(Login_ReqTokenLoginHandler.java:39) at com.game.engine.script.ScriptLoader.lambda 0(LoginReqTokenLoginHandler.java:39)atcom.game.engine.script.ScriptLoader.lambdaconsumerScripts 0 ( S c r i p t L o a d e r . j a v a : 200 ) a t j a v a . u t i l . c o n c u r r e n t . C o n c u r r e n t H a s h M a p 0(ScriptLoader.java:200) at java.util.concurrent.ConcurrentHashMap 0(ScriptLoader.java:200)atjava.util.concurrent.ConcurrentHashMapValuesView.forEach(ConcurrentHashMap.java:4707)
at com.game.engine.script.ScriptLoader.consumerScripts(ScriptLoader.java:198)
at com.game.handler.tcp.login.Login_ReqTokenLoginHandler.run(Login_ReqTokenLoginHandler.java:38)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.net.SocketInputStream.read(SocketInputStream.java:127)
at redis.clients.jedis.util.RedisInputStream.ensureFill(RedisInputStream.java:199)
… 20 more

com.mongodb.MongoSocketReadTimeoutException: Timeout while receiving message
at com.mongodb.connection.InternalStreamConnection.translateReadException(InternalStreamConnection.java:477)
at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:228)
at com.mongodb.connection.UsageTrackingInternalConnection.receiveMessage(UsageTrackingInternalConnection.java:96)
at com.mongodb.connection.DefaultConnectionPool P o o l e d C o n n e c t i o n . r e c e i v e M e s s a g e ( D e f a u l t C o n n e c t i o n P o o l . j a v a : 440 ) a t c o m . m o n g o d b . c o n n e c t i o n . C o m m a n d P r o t o c o l . e x e c u t e ( C o m m a n d P r o t o c o l . j a v a : 112 ) a t c o m . m o n g o d b . c o n n e c t i o n . D e f a u l t S e r v e r PooledConnection.receiveMessage(DefaultConnectionPool.java:440) at com.mongodb.connection.CommandProtocol.execute(CommandProtocol.java:112) at com.mongodb.connection.DefaultServer PooledConnection.receiveMessage(DefaultConnectionPool.java:440)atcom.mongodb.connection.CommandProtocol.execute(CommandProtocol.java:112)atcom.mongodb.connection.DefaultServerDefaultServerProtocolExecutor.execute(DefaultServer.java:168)
at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:289)
at com.mongodb.connection.DefaultServerConnection.command(DefaultServerConnection.java:176)
at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:216)
at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:207)
at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:113)
at com.mongodb.operation.FindOperation$1.call(FindOperation.java:516)
at com.mongodb.operation.FindOperation$1.call(FindOperation.java:510)
at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:431)
at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:404)
at com.mongodb.operation.FindOperation.execute(FindOperation.java:510)
at com.mongodb.operation.FindOperation.execute(FindOperation.java:81)
at com.mongodb.Mongo.execute(Mongo.java:836)
at com.mongodb.Mongo 2. e x e c u t e ( M o n g o . j a v a : 823 ) a t c o m . m o n g o d b . D B C u r s o r . i n i t i a l i z e C u r s o r ( D B C u r s o r . j a v a : 870 ) a t c o m . m o n g o d b . D B C u r s o r . h a s N e x t ( D B C u r s o r . j a v a : 142 ) a t o r g . m o n g o d b . m o r p h i a . q u e r y . M o r p h i a I t e r a t o r . h a s N e x t ( M o r p h i a I t e r a t o r . j a v a : 106 ) a t o r g . m o n g o d b . m o r p h i a . q u e r y . Q u e r y I m p l . g e t ( Q u e r y I m p l . j a v a : 236 ) a t o r g . m o n g o d b . m o r p h i a . q u e r y . Q u e r y I m p l . g e t ( Q u e r y I m p l . j a v a : 227 ) a t o r g . m o n g o d b . m o r p h i a . D a t a s t o r e I m p l . g e t ( D a t a s t o r e I m p l . j a v a : 421 ) a t o r g . m o n g o d b . m o r p h i a . d a o . B a s i c D A O . g e t ( B a s i c D A O . j a v a : 207 ) a t c o m . g a m e . l o g i n s r . d a o . P l a y e r E c t y p e D a o . f i n d P l a y e r E c t y p e ( P l a y e r E c t y p e D a o . j a v a : 26 ) a t c o m . g a m e . l o g i n s r . m a n a g e r . S e r v e r M a n a g e r . b a c k S e r v e r s S h o w I n f o ( S e r v e r M a n a g e r . j a v a : 148 ) a t c o m . g a m e . l o g i n s r . m a n a g e r . S e r v e r M a n a g e r . b u i l d S e r v e r I n f o ( S e r v e r M a n a g e r . j a v a : 128 ) a t c o m . g a m e . s c r i p t s . l o g i n . L o g i n S c r i p t . b u i l d S e r v e r I n f o ( L o g i n S c r i p t . j a v a : 186 ) a t c o m . g a m e . s c r i p t s . l o g i n . L o g i n S c r i p t . g e t G a m e L i s t ( L o g i n S c r i p t . j a v a : 158 ) a t c o m . g a m e . s c r i p t s . l o g i n . L o g i n S c r i p t . l o g i n ( L o g i n S c r i p t . j a v a : 123 ) a t c o m . g a m e . h a n d l e r . t c p . l o g i n . L o g i n R e q T o k e n L o g i n H a n d l e r . l a m b d a 2.execute(Mongo.java:823) at com.mongodb.DBCursor.initializeCursor(DBCursor.java:870) at com.mongodb.DBCursor.hasNext(DBCursor.java:142) at org.mongodb.morphia.query.MorphiaIterator.hasNext(MorphiaIterator.java:106) at org.mongodb.morphia.query.QueryImpl.get(QueryImpl.java:236) at org.mongodb.morphia.query.QueryImpl.get(QueryImpl.java:227) at org.mongodb.morphia.DatastoreImpl.get(DatastoreImpl.java:421) at org.mongodb.morphia.dao.BasicDAO.get(BasicDAO.java:207) at com.game.loginsr.dao.PlayerEctypeDao.findPlayerEctype(PlayerEctypeDao.java:26) at com.game.loginsr.manager.ServerManager.backServersShowInfo(ServerManager.java:148) at com.game.loginsr.manager.ServerManager.buildServerInfo(ServerManager.java:128) at com.game.scripts.login.LoginScript.buildServerInfo(LoginScript.java:186) at com.game.scripts.login.LoginScript.getGameList(LoginScript.java:158) at com.game.scripts.login.LoginScript.login(LoginScript.java:123) at com.game.handler.tcp.login.Login_ReqTokenLoginHandler.lambda 2.execute(Mongo.java:823)atcom.mongodb.DBCursor.initializeCursor(DBCursor.java:870)atcom.mongodb.DBCursor.hasNext(DBCursor.java:142)atorg.mongodb.morphia.query.MorphiaIterator.hasNext(MorphiaIterator.java:106)atorg.mongodb.morphia.query.QueryImpl.get(QueryImpl.java:236)atorg.mongodb.morphia.query.QueryImpl.get(QueryImpl.java:227)atorg.mongodb.morphia.DatastoreImpl.get(DatastoreImpl.java:421)atorg.mongodb.morphia.dao.BasicDAO.get(BasicDAO.java:207)atcom.game.loginsr.dao.PlayerEctypeDao.findPlayerEctype(PlayerEctypeDao.java:26)atcom.game.loginsr.manager.ServerManager.backServersShowInfo(ServerManager.java:148)atcom.game.loginsr.manager.ServerManager.buildServerInfo(ServerManager.java:128)atcom.game.scripts.login.LoginScript.buildServerInfo(LoginScript.java:186)atcom.game.scripts.login.LoginScript.getGameList(LoginScript.java:158)atcom.game.scripts.login.LoginScript.login(LoginScript.java:123)atcom.game.handler.tcp.login.LoginReqTokenLoginHandler.lambdarun 0 ( L o g i n R e q T o k e n L o g i n H a n d l e r . j a v a : 39 ) a t c o m . g a m e . e n g i n e . s c r i p t . S c r i p t L o a d e r . l a m b d a 0(Login_ReqTokenLoginHandler.java:39) at com.game.engine.script.ScriptLoader.lambda 0(LoginReqTokenLoginHandler.java:39)atcom.game.engine.script.ScriptLoader.lambdaconsumerScripts 0 ( S c r i p t L o a d e r . j a v a : 200 ) a t j a v a . u t i l . c o n c u r r e n t . C o n c u r r e n t H a s h M a p 0(ScriptLoader.java:200) at java.util.concurrent.ConcurrentHashMap 0(ScriptLoader.java:200)atjava.util.concurrent.ConcurrentHashMapValuesView.forEach(ConcurrentHashMap.java:4707)
at com.game.engine.script.ScriptLoader.consumerScripts(ScriptLoader.java:198)
at com.game.handler.tcp.login.Login_ReqTokenLoginHandler.run(Login_ReqTokenLoginHandler.java:38)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at com.mongodb.connection.SocketStream.read(SocketStream.java:85)
at com.mongodb.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:494)
at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:224)
… 38 more

Exception in thread “主线程组TCP pool-5-thread-1” com.mongodb.MongoSocketReadTimeoutException: Timeout while receiving message
at com.mongodb.connection.InternalStreamConnection.translateReadException(InternalStreamConnection.java:477)
at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:228)
at com.mongodb.connection.UsageTrackingInternalConnection.receiveMessage(UsageTrackingInternalConnection.java:96)
at com.mongodb.connection.DefaultConnectionPool P o o l e d C o n n e c t i o n . r e c e i v e M e s s a g e ( D e f a u l t C o n n e c t i o n P o o l . j a v a : 440 ) a t c o m . m o n g o d b . c o n n e c t i o n . W r i t e C o m m a n d P r o t o c o l . r e c e i v e M e s s a g e ( W r i t e C o m m a n d P r o t o c o l . j a v a : 262 ) a t c o m . m o n g o d b . c o n n e c t i o n . W r i t e C o m m a n d P r o t o c o l . e x e c u t e ( W r i t e C o m m a n d P r o t o c o l . j a v a : 104 ) a t c o m . m o n g o d b . c o n n e c t i o n . U p d a t e C o m m a n d P r o t o c o l . e x e c u t e ( U p d a t e C o m m a n d P r o t o c o l . j a v a : 64 ) a t c o m . m o n g o d b . c o n n e c t i o n . U p d a t e C o m m a n d P r o t o c o l . e x e c u t e ( U p d a t e C o m m a n d P r o t o c o l . j a v a : 37 ) a t c o m . m o n g o d b . c o n n e c t i o n . D e f a u l t S e r v e r PooledConnection.receiveMessage(DefaultConnectionPool.java:440) at com.mongodb.connection.WriteCommandProtocol.receiveMessage(WriteCommandProtocol.java:262) at com.mongodb.connection.WriteCommandProtocol.execute(WriteCommandProtocol.java:104) at com.mongodb.connection.UpdateCommandProtocol.execute(UpdateCommandProtocol.java:64) at com.mongodb.connection.UpdateCommandProtocol.execute(UpdateCommandProtocol.java:37) at com.mongodb.connection.DefaultServer PooledConnection.receiveMessage(DefaultConnectionPool.java:440)atcom.mongodb.connection.WriteCommandProtocol.receiveMessage(WriteCommandProtocol.java:262)atcom.mongodb.connection.WriteCommandProtocol.execute(WriteCommandProtocol.java:104)atcom.mongodb.connection.UpdateCommandProtocol.execute(UpdateCommandProtocol.java:64)atcom.mongodb.connection.UpdateCommandProtocol.execute(UpdateCommandProtocol.java:37)atcom.mongodb.connection.DefaultServerDefaultServerProtocolExecutor.execute(DefaultServer.java:168)
at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:289)
at com.mongodb.connection.DefaultServerConnection.updateCommand(DefaultServerConnection.java:143)
at com.mongodb.operation.UpdateOperation.executeCommandProtocol(UpdateOperation.java:89)
at com.mongodb.operation.BaseWriteOperation$1.call(BaseWriteOperation.java:139)
at com.mongodb.operation.BaseWriteOperation$1.call(BaseWriteOperation.java:133)
at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:422)
at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:413)
at com.mongodb.operation.BaseWriteOperation.execute(BaseWriteOperation.java:133)
at com.mongodb.operation.BaseWriteOperation.execute(BaseWriteOperation.java:60)
at com.mongodb.Mongo.execute(Mongo.java:845)
at com.mongodb.Mongo 2. e x e c u t e ( M o n g o . j a v a : 828 ) a t c o m . m o n g o d b . D B C o l l e c t i o n . e x e c u t e W r i t e O p e r a t i o n ( D B C o l l e c t i o n . j a v a : 342 ) a t c o m . m o n g o d b . D B C o l l e c t i o n . u p d a t e ( D B C o l l e c t i o n . j a v a : 567 ) a t o r g . m o n g o d b . m o r p h i a . D a t a s t o r e I m p l . s a v e D o c u m e n t ( D a t a s t o r e I m p l . j a v a : 1299 ) a t o r g . m o n g o d b . m o r p h i a . D a t a s t o r e I m p l . s a v e ( D a t a s t o r e I m p l . j a v a : 1289 ) a t o r g . m o n g o d b . m o r p h i a . D a t a s t o r e I m p l . s a v e ( D a t a s t o r e I m p l . j a v a : 775 ) a t o r g . m o n g o d b . m o r p h i a . D a t a s t o r e I m p l . s a v e ( D a t a s t o r e I m p l . j a v a : 758 ) a t o r g . m o n g o d b . m o r p h i a . d a o . B a s i c D A O . s a v e ( B a s i c D A O . j a v a : 230 ) a t c o m . g a m e . s c r i p t s . t i m e r . p l a y e r . P l a y e r H e a r t T i m e r S c r i p t . l a m b d a 2.execute(Mongo.java:828) at com.mongodb.DBCollection.executeWriteOperation(DBCollection.java:342) at com.mongodb.DBCollection.update(DBCollection.java:567) at org.mongodb.morphia.DatastoreImpl.saveDocument(DatastoreImpl.java:1299) at org.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:1289) at org.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:775) at org.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:758) at org.mongodb.morphia.dao.BasicDAO.save(BasicDAO.java:230) at com.game.scripts.timer.player.PlayerHeartTimerScript.lambda 2.execute(Mongo.java:828)atcom.mongodb.DBCollection.executeWriteOperation(DBCollection.java:342)atcom.mongodb.DBCollection.update(DBCollection.java:567)atorg.mongodb.morphia.DatastoreImpl.saveDocument(DatastoreImpl.java:1299)atorg.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:1289)atorg.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:775)atorg.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:758)atorg.mongodb.morphia.dao.BasicDAO.save(BasicDAO.java:230)atcom.game.scripts.timer.player.PlayerHeartTimerScript.lambdaminuteHandler 12 ( P l a y e r H e a r t T i m e r S c r i p t . j a v a : 185 ) a t j a v a . u t i l . c o n c u r r e n t . T h r e a d P o o l E x e c u t o r . r u n W o r k e r ( T h r e a d P o o l E x e c u t o r . j a v a : 1149 ) a t j a v a . u t i l . c o n c u r r e n t . T h r e a d P o o l E x e c u t o r 12(PlayerHeartTimerScript.java:185) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor 12(PlayerHeartTimerScript.java:185)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)atjava.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at com.mongodb.connection.SocketStream.read(SocketStream.java:85)
at com.mongodb.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:494)
at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:224)
… 29 more
Exception in thread “主线程组TCP pool-5-thread-4” com.mongodb.MongoSocketReadTimeoutException: Timeout while receiving message
at com.mongodb.connection.InternalStreamConnection.translateReadException(InternalStreamConnection.java:477)
at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:228)
at com.mongodb.connection.UsageTrackingInternalConnection.receiveMessage(UsageTrackingInternalConnection.java:96)
at com.mongodb.connection.DefaultConnectionPool P o o l e d C o n n e c t i o n . r e c e i v e M e s s a g e ( D e f a u l t C o n n e c t i o n P o o l . j a v a : 440 ) a t c o m . m o n g o d b . c o n n e c t i o n . W r i t e C o m m a n d P r o t o c o l . r e c e i v e M e s s a g e ( W r i t e C o m m a n d P r o t o c o l . j a v a : 262 ) a t c o m . m o n g o d b . c o n n e c t i o n . W r i t e C o m m a n d P r o t o c o l . e x e c u t e ( W r i t e C o m m a n d P r o t o c o l . j a v a : 104 ) a t c o m . m o n g o d b . c o n n e c t i o n . U p d a t e C o m m a n d P r o t o c o l . e x e c u t e ( U p d a t e C o m m a n d P r o t o c o l . j a v a : 64 ) a t c o m . m o n g o d b . c o n n e c t i o n . U p d a t e C o m m a n d P r o t o c o l . e x e c u t e ( U p d a t e C o m m a n d P r o t o c o l . j a v a : 37 ) a t c o m . m o n g o d b . c o n n e c t i o n . D e f a u l t S e r v e r PooledConnection.receiveMessage(DefaultConnectionPool.java:440) at com.mongodb.connection.WriteCommandProtocol.receiveMessage(WriteCommandProtocol.java:262) at com.mongodb.connection.WriteCommandProtocol.execute(WriteCommandProtocol.java:104) at com.mongodb.connection.UpdateCommandProtocol.execute(UpdateCommandProtocol.java:64) at com.mongodb.connection.UpdateCommandProtocol.execute(UpdateCommandProtocol.java:37) at com.mongodb.connection.DefaultServer PooledConnection.receiveMessage(DefaultConnectionPool.java:440)atcom.mongodb.connection.WriteCommandProtocol.receiveMessage(WriteCommandProtocol.java:262)atcom.mongodb.connection.WriteCommandProtocol.execute(WriteCommandProtocol.java:104)atcom.mongodb.connection.UpdateCommandProtocol.execute(UpdateCommandProtocol.java:64)atcom.mongodb.connection.UpdateCommandProtocol.execute(UpdateCommandProtocol.java:37)atcom.mongodb.connection.DefaultServerDefaultServerProtocolExecutor.execute(DefaultServer.java:168)
at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:289)
at com.mongodb.connection.DefaultServerConnection.updateCommand(DefaultServerConnection.java:143)
at com.mongodb.operation.UpdateOperation.executeCommandProtocol(UpdateOperation.java:89)
at com.mongodb.operation.BaseWriteOperation$1.call(BaseWriteOperation.java:139)
at com.mongodb.operation.BaseWriteOperation$1.call(BaseWriteOperation.java:133)
at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:422)
at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:413)
at com.mongodb.operation.BaseWriteOperation.execute(BaseWriteOperation.java:133)
at com.mongodb.operation.BaseWriteOperation.execute(BaseWriteOperation.java:60)
at com.mongodb.Mongo.execute(Mongo.java:845)
at com.mongodb.Mongo 2. e x e c u t e ( M o n g o . j a v a : 828 ) a t c o m . m o n g o d b . D B C o l l e c t i o n . e x e c u t e W r i t e O p e r a t i o n ( D B C o l l e c t i o n . j a v a : 342 ) a t c o m . m o n g o d b . D B C o l l e c t i o n . u p d a t e ( D B C o l l e c t i o n . j a v a : 567 ) a t o r g . m o n g o d b . m o r p h i a . D a t a s t o r e I m p l . s a v e D o c u m e n t ( D a t a s t o r e I m p l . j a v a : 1299 ) a t o r g . m o n g o d b . m o r p h i a . D a t a s t o r e I m p l . s a v e ( D a t a s t o r e I m p l . j a v a : 1289 ) a t o r g . m o n g o d b . m o r p h i a . D a t a s t o r e I m p l . s a v e ( D a t a s t o r e I m p l . j a v a : 775 ) a t o r g . m o n g o d b . m o r p h i a . D a t a s t o r e I m p l . s a v e ( D a t a s t o r e I m p l . j a v a : 758 ) a t o r g . m o n g o d b . m o r p h i a . d a o . B a s i c D A O . s a v e ( B a s i c D A O . j a v a : 230 ) a t c o m . g a m e . m a n a g e r . S t a l l M a n a g e r . s t o p ( S t a l l M a n a g e r . j a v a : 1055 ) a t c o m . g a m e . s t r u c t s . s t a l l . M a r k e t T i m e r . l a m b d a 2.execute(Mongo.java:828) at com.mongodb.DBCollection.executeWriteOperation(DBCollection.java:342) at com.mongodb.DBCollection.update(DBCollection.java:567) at org.mongodb.morphia.DatastoreImpl.saveDocument(DatastoreImpl.java:1299) at org.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:1289) at org.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:775) at org.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:758) at org.mongodb.morphia.dao.BasicDAO.save(BasicDAO.java:230) at com.game.manager.StallManager.stop(StallManager.java:1055) at com.game.structs.stall.MarketTimer.lambda 2.execute(Mongo.java:828)atcom.mongodb.DBCollection.executeWriteOperation(DBCollection.java:342)atcom.mongodb.DBCollection.update(DBCollection.java:567)atorg.mongodb.morphia.DatastoreImpl.saveDocument(DatastoreImpl.java:1299)atorg.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:1289)atorg.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:775)atorg.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:758)atorg.mongodb.morphia.dao.BasicDAO.save(BasicDAO.java:230)atcom.game.manager.StallManager.stop(StallManager.java:1055)atcom.game.structs.stall.MarketTimer.lambdarun 0 ( M a r k e t T i m e r . j a v a : 37 ) a t j a v a . u t i l . c o n c u r r e n t . T h r e a d P o o l E x e c u t o r . r u n W o r k e r ( T h r e a d P o o l E x e c u t o r . j a v a : 1149 ) a t j a v a . u t i l . c o n c u r r e n t . T h r e a d P o o l E x e c u t o r 0(MarketTimer.java:37) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor 0(MarketTimer.java:37)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)atjava.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at com.mongodb.connection.SocketStream.read(SocketStream.java:85)
at com.mongodb.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:494)
at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:224)
… 30 more

你可能感兴趣的:(项目连接数据库、redis、mongodb隔一会就报错处理)