taosdata / TDengine

High-performance, scalable time-series database designed for Industrial IoT (IIoT) scenarios
https://tdengine.com
GNU Affero General Public License v3.0
23.38k stars 4.86k forks source link

springboot+mybaties:Unable to establish connection #4430

Closed lijiangtaoljt closed 2 years ago

lijiangtaoljt commented 3 years ago

Bug Description 我建表除了时间其余140个filed都是binary(30)创建,但是写入的时候插入的数值 (微信图片_20201203180116多一个就不行了,就报Unable to establish connection这个错误。之前一直不能写入,有一次突然可以完整正常写入人,然后断了下网络又不能继续写入了

问题初步定位:参数多就不行

成功写入 2020-12-03 18:13:54.411 DEBUG 288 --- [nio-8080-exec-2] c.e.taos.dao.WeatherMapper.inserts : ==> Preparing: insert into db.wdf201905130000001 values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?); 2020-12-03 18:13:54.442 DEBUG 288 --- [nio-8080-exec-2] c.e.taos.dao.WeatherMapper.inserts : ==> Parameters: 2020-12-03 18:13:54.379(Timestamp), WDF201905130000001(String), 0.0(String), 0.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 0.1(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 11111.0(String), 111.0(String), 111(String) 2020-12-03 18:13:54.487 DEBUG 288 --- [nio-8080-exec-2] c.e.taos.dao.WeatherMapper.inserts : <== Updates: 1

和下面错误程序区别在后几位的参数长度上,但是参数长度又是满足建表时规定的长度。 java程序报错信息 2020-12-03 17:54:38.411 DEBUG 1268 --- [nio-8080-exec-2] c.e.taos.dao.WeatherMapper.inserts : ==> Preparing: insert into db.wdf201905130000001 values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?); 2020-12-03 17:54:38.432 DEBUG 1268 --- [nio-8080-exec-2] c.e.taos.dao.WeatherMapper.inserts : ==> Parameters: 2020-12-03 17:54:38.384(Timestamp), WDF201905130000001(String), 0.0(String), 0.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 0.1(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 11111.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 111111.0(String), 1.0(String), 1.0(String), 1111.0(String), 1.0(String), 1111.0(String), 1.0(String), 1.0(String), 1.0(String), 11111.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1111.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 11111.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1.0(String), 1111.0(String), 1.0(String), 1.0(String), 1111.0(String), 1.0(String), 1.0(String), 111111111.0(String), 1111111.0(String), 111111.0(String), 111111.0(String), 111111.0(String), 111111.0(String), 111111.0(String), 111111.0(String), 1111.0(String), 11111.0(String), 11111.0(String), 111(String) 2020-12-03 17:55:02.791 ERROR 1268 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/taosd] threw exception [Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException:

Error updating database. Cause: java.sql.SQLException: TDengine Error: Unable to establish connection

The error may exist in file [D:\wdf\wdf-taosd\target\classes\mapper\WeatherMapper.xml]

The error may involve com.example.taos.dao.WeatherMapper.inserts-Inline

The error occurred while setting parameters

SQL: insert into db.wdf201905130000001 values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);

Cause: java.sql.SQLException: TDengine Error: Unable to establish connection

; uncategorized SQLException; SQL state []; error code [-2147483637]; TDengine Error: Unable to establish connection; nested exception is java.sql.SQLException: TDengine Error: Unable to establish connection] with root cause

java.sql.SQLException: TDengine Error: Unable to establish connection at com.taosdata.jdbc.TSDBJNIConnector.executeQuery(TSDBJNIConnector.java:135) ~[taos-jdbcdriver-2.0.12.jar:na] at com.taosdata.jdbc.TSDBStatement.executeUpdate(TSDBStatement.java:100) ~[taos-jdbcdriver-2.0.12.jar:na] at com.taosdata.jdbc.SavedPreparedStatement.executeSql(SavedPreparedStatement.java:450) ~[taos-jdbcdriver-2.0.12.jar:na] at com.taosdata.jdbc.SavedPreparedStatement.executeBatchInternal(SavedPreparedStatement.java:259) ~[taos-jdbcdriver-2.0.12.jar:na] at com.taosdata.jdbc.TSDBPreparedStatement.execute(TSDBPreparedStatement.java:304) ~[taos-jdbcdriver-2.0.12.jar:na] at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497) ~[druid-1.1.17.jar:1.1.17] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161] at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59) ~[mybatis-3.5.5.jar:3.5.5] at com.sun.proxy.$Proxy127.execute(Unknown Source) ~[na:na] at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47) ~[mybatis-3.5.5.jar:3.5.5] at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) ~[mybatis-3.5.5.jar:3.5.5] at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) ~[mybatis-3.5.5.jar:3.5.5] at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.5.5.jar:3.5.5] at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) ~[mybatis-3.5.5.jar:3.5.5] at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197) ~[mybatis-3.5.5.jar:3.5.5] at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184) ~[mybatis-3.5.5.jar:3.5.5] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161] at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ~[mybatis-spring-2.0.5.jar:2.0.5] at com.sun.proxy.$Proxy86.insert(Unknown Source) ~[na:na] at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:271) ~[mybatis-spring-2.0.5.jar:2.0.5] at com.baomidou.mybatisplus.core.override.PageMapperMethod.execute(PageMapperMethod.java:68) ~[mybatis-plus-core-3.0.7.1.jar:3.0.7.1] at com.baomidou.mybatisplus.core.override.PageMapperProxy.invoke(PageMapperProxy.java:64) ~[mybatis-plus-core-3.0.7.1.jar:3.0.7.1] at com.sun.proxy.$Proxy91.inserts(Unknown Source) ~[na:na] at com.example.taos.service.WeatherService.inserts(WeatherService.java:91) ~[classes/:na] at com.example.taos.controller.WeatherController.inserts(WeatherController.java:200) ~[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) ~[spring-webmvc-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878) ~[spring-webmvc-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792) ~[spring-webmvc-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.2.10.RELEASE.jar:5.2.10.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:626) ~[tomcat-embed-core-9.0.39.jar:4.0.FR] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.2.10.RELEASE.jar:5.2.10.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) ~[tomcat-embed-core-9.0.39.jar:4.0.FR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.39.jar:9.0.39] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.39.jar:9.0.39] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.39.jar:9.0.39] at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.39.jar:9.0.39] at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93) ~[spring-boot-actuator-2.3.5.RELEASE.jar:2.3.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.39.jar:9.0.39] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) [tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) [tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) [tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) [tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374) [tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) [tomcat-embed-core-9.0.39.jar:9.0.39] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.39.jar:9.0.39] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_161] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_161] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.39.jar:9.0.39] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_161]

server端日志: server端log.txt

client日志 clientlog.txt

Additional Context 请帮忙看看问题所在

zyyang90 commented 2 years ago

This issue is stale because it has been open for 30 days with no activity.