programing

SQLNonTransientConnection을 처리하는 방법예외?

elecom 2023. 10. 15. 16:59
반응형

SQLNonTransientConnection을 처리하는 방법예외?

오류입니다.

5760 feb 04 07:45:17 TestServer java[13777]: java.sql.SQLNonTransientConnectionException: Could not read resultset: unexpected end of stream, read 0bytes from 4
5761 feb 04 07:45:17 TestServer java[13777]: at org.mariadb.jdbc.internal.SQLExceptionMapper.get(SQLExceptionMapper.java:136)
5762 feb 04 07:45:17 TestServer java[13777]: at org.mariadb.jdbc.internal.SQLExceptionMapper.throwException(SQLExceptionMapper.java:106)
5763 feb 04 07:45:17 TestServer java[13777]: at org.mariadb.jdbc.MySQLStatement.executeQueryEpilog(MySQLStatement.java:264)
5764 feb 04 07:45:17 TestServer java[13777]: at org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:288)
5765 feb 04 07:45:17 TestServer java[13777]: at org.mariadb.jdbc.MySQLStatement.executeUpdate(MySQLStatement.java:317)
5766 feb 04 07:45:17 TestServer java[13777]: at org.mariadb.jdbc.MySQLPreparedStatement.executeUpdate(MySQLPreparedStatement.java:156)
5767 feb 04 07:45:17 TestServer java[13777]: at com.zaxxer.hikari.proxy.PreparedStatementProxy.executeUpdate(PreparedStatementProxy.java:61)
5768 feb 04 07:45:17 TestServer java[13777]: at com.zaxxer.hikari.proxy.PreparedStatementJavassistProxy.executeUpdate(PreparedStatementJavassistProxy.java)
5769 feb 04 07:45:17 TestServer java[13777]: at com.testserver.deviceapi.data.DataDAO.insertBootEvent(DataDAO.java:64)
5770 feb 04 07:45:17 TestServer java[13777]: at com.testserver.deviceapi.server.ServerRunnable.processJsonObject(ServerRunnable.java:198)
5771 feb 04 07:45:17 TestServer java[13777]: at com.testserver.deviceapi.server.ServerRunnable.run(ServerRunnable.java:93)
5772 feb 04 07:45:17 TestServer java[13777]: at java.lang.Thread.run(Thread.java:745)
5773 feb 04 07:45:17 TestServer java[13777]: Caused by: org.mariadb.jdbc.internal.common.QueryException: Could not read resultset: unexpected end of stream, read 0bytes from 4
5774 feb 04 07:45:17 TestServer java[13777]: at org.mariadb.jdbc.internal.mysql.MySQLProtocol.getResult(MySQLProtocol.java:926)
5775 feb 04 07:45:17 TestServer java[13777]: at org.mariadb.jdbc.internal.mysql.MySQLProtocol.executeQuery(MySQLProtocol.java:991)
5776 feb 04 07:45:17 TestServer java[13777]: at org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:281)
5777 feb 04 07:45:17 TestServer java[13777]: ... 8 more
5778 feb 04 07:45:17 TestServer java[13777]: Caused by: java.io.EOFException: unexpected end of stream, read 0bytes from 4
5779 feb 04 07:45:17 TestServer java[13777]: at org.mariadb.jdbc.internal.common.packet.buffer.ReadUtil.readFully(ReadUtil.java:84)
5780 feb 04 07:45:17 TestServer java[13777]: at org.mariadb.jdbc.internal.common.packet.buffer.ReadUtil.readFully(ReadUtil.java:92)
5781 feb 04 07:45:17 TestServer java[13777]: at org.mariadb.jdbc.internal.common.packet.RawPacket.nextPacket(RawPacket.java:77)
5782 feb 04 07:45:17 TestServer java[13777]: at org.mariadb.jdbc.internal.common.packet.SyncPacketFetcher.getRawPacket(SyncPacketFetcher.java:67)
5783 feb 04 07:45:17 TestServer java[13777]: at org.mariadb.jdbc.internal.mysql.MySQLProtocol.getResult(MySQLProtocol.java:894)
5784 feb 04 07:45:17 TestServer java[13777]: ... 10 more

서버는 CentOS에서 서비스로 실행되는 자바 서버입니다.어제서야 서비스로 구현했는데, 그런 시도는 처음입니다.어제 저녁으로 모든 것이 괜찮았습니다.LAN에서 서버를 테스트해보니 문제없이 LAN 외부에서 연결이 되었고, 모든 데이터가 정상적으로 처리되어 저장되었습니다.

자바독이 할 말은 이렇습니다SQLNonTransientConnectionException:

SQLState 클래스 값 '08'에 대해 처리된 SQLException의 하위 클래스 또는 벤더가 지정한 조건에서 처리됩니다.즉, 실패 원인을 수정하지 않은 상태에서 작업을 다시 시도하면 실패한 연결 작업이 성공하지 못합니다.이 예외가 발생할 수 있는 공급업체가 지정한 조건에 대해서는 드라이버 공급업체 문서를 참조하십시오.

SQL 클래스'08'은 다음을 의미합니다.

Table 6. Class Code 08: Connection Exception
SQLSTATE Value    Meaning
08001             The connection was unable to be established to the application server or other server.
08002             The connection already exists.
08003             The connection does not exist.
08004             The application server rejected establishment of the connection.

그래서 오늘 아침에 와서 이런 오류가 발생했을 때 테스트 클라이언트와 함께 데이터베이스에 데이터 오류가 발생했을 때 말이죠.몇 번의 시도 끝에 동일한 버전인 로컬 머신에서 서버를 실행했고 아무런 문제 없이 작동했으며 메인 서버의 데이터베이스에 성공적으로 연결하고 동일한 클라이언트에서 동일한 데이터를 문제없이 저장했습니다.

다음으로 메인 서버에서 서비스를 다시 시작했습니다.그 시점부터 모든 것이 정상으로 돌아왔고, 무엇이 오류를 일으켰는지에 대해서는 전혀 알지 못합니다.

이런 거 아닐까요?하지만 그 에러 메세지는Last packet not finished내것이 있는곳Could not read resultset: unexpected end of stream, read 0bytes from 4.

이게 뭔지 알아요?어떻게 처리해야 합니까?다시 시도해도 문제가 해결되지 않는다는 것이 오류로 분명하기 때문에 오류를 파악하고 서버를 종료할 수 있을 것 같습니다.서비스가 바로 다시 시작되도록 설정되어 있으므로 센트OS가 자체 종료되면 다시 시작합니다.이것이 합당한 일입니까?

언급URL : https://stackoverflow.com/questions/28317085/how-should-i-handle-an-sqlnontransientconnectionexception

반응형