what is java.io.EOFException, Message: Can not read response from server. Expected to read 4 bytes, read 0 bytes

前端 未结 8 2184
隐瞒了意图╮
隐瞒了意图╮ 2020-12-14 00:18

This question has been asked a couple of times in SO and many times in other sites. But I didn\'t get any satisfiable answer.

My problem:
I have a java web app

8条回答
  •  既然无缘
    2020-12-14 00:53

    While I don't have definitive solutions, it seems something is interfering communication between the app server and db. Following are few things you can try to isolate the problems:

    • Try to determine wether this is mysql problem or java code problem. Try connect to mysql using the command line tool from the same host as the app server and issue similar SQL to perform login. Test using a simple java code that does a select, deploy it to the same infrastructure, see what happen etc. Also check the mysql server log, see if you can find anything useful

    • There are two way an idle connection get closed: by the connection pool code that runs inside app server, or by mysql itself. Make sure you check the config on both sides

    • Check if any network infrastructure config has changed recently. Was there any new firewall rule in place interfering with app server <--> mysql connectivity? Was there any settings that prohibits open TCP connection idling longer than X?

    • Try a different connection pooling library just to eliminate the possibility it's the connection pooling

    Good luck

提交回复
热议问题