Tdengine 遇到的问题

在开发环境中,SQL查询能正常执行,但在测试服务器上遇到错误,具体表现为`java.lang.NoSuchMethodError`,涉及到了FastJSON的`JSONArray.getTimestamp`方法。错误发生在Druid数据源处理查询时,可能与TAOS数据库的驱动兼容性有关。
摘要由CSDN通过智能技术生成

在开发服务器正常执行 ,在测试服务器报sql错误,拼接出来的sql使用客户端连接也是可以正常执行的

2023-07-31 15:19:00 [com.hdtd.jetlinks.collect.business.hourinfo.collect.service.impl.TaosElectricityMeterInfoServiceImpl#taosElectricityMeterInfoAddIotHourInfo]-[77]-[xxl-job, JobThread-116-1690787940258] 查询入taos库开始时间是QueryTaosElectricityMeterInfoDto(startDate=Tue Feb 28 14:00:00 CST 2023, endDate=Tue Feb 28 14:59:59 CST 2023, lastWeek=Tue Feb 21 14:00:00 CST 2023, key=20230228142023022814) 2023-07-31 15:19:05 [com.xxl.job.core.thread.JobThread#run]-[204]-[xxl-job, JobThread-116-1690787940258]
----------- JobThread Exception:java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.xxl.job.core.handler.impl.MethodJobHandler.execute(MethodJobHandler.java:31) at com.xxl.job.core.thread.JobThread.run(JobThread.java:166) Caused by: org.springframework.jdbc.UncategorizedSQLException: ### Error querying database. Cause: java.sql.SQLException: Error ### The error may exist in file [D:\project\jetlinks-pro-datacollect\target\classes\mybatis\collectandstorage\TaosElectricityMeterInfoMapper.xml] ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: SELECT max(ep) as ep_max, min(ep) as ep_min, max(ep)-min(ep) AS e_total, SUM(ua) AS ua_total, COUNT(ua) AS ua_total_num, SUM(ub) AS ub_total, COUNT(ub) AS ub_total_num, SUM(uc) AS uc_total, COUNT(uc) AS uc_total_num, SUM(ia) AS ia_total, COUNT(ia) AS ia_total_num, SUM(ib) AS ib_total, COUNT(ib) AS ib_total_num, SUM(ic) AS ic_total, COUNT(ic) AS ic_total_num, SUM(pa) AS pa_total, COUNT(pa) AS pa_total_num, SUM(pb) AS pb_total, COUNT(pb) AS pb_total_num, SUM(pc) AS pc_total, COUNT(pc) AS pc_total_num, SUM(pt) AS pt_total, COUNT(pt) AS pt_total_num, SUM(qa) AS qa_total, COUNT(qa) AS qa_total_num, SUM(qb) AS qb_total, COUNT(qb) AS qb_total_num, SUM(qc) AS qc_total, COUNT(qc) AS qc_total_num, SUM(qt) AS qt_total, COUNT(qt) AS qt_total_num, SUM(sa) AS sa_total, COUNT(sa) AS sa_total_num, SUM(sb) AS sb_total, COUNT(sb) AS sb_total_num, SUM(sc) AS sc_total, COUNT(sc) AS sc_total_num, SUM(st) AS st_total, COUNT(st) AS st_total_num, SUM(fa) AS fa_total, COUNT(fa) AS fa_total_num, SUM(fb) AS fb_total, COUNT(fb) AS fb_total_num, SUM(fc) AS fc_total, COUNT(fc) AS fc_total_num, SUM(ft) AS ft_total, COUNT(ft) AS ft_total_num, SUM(er) AS er_total, COUNT(er) AS er_total_num, SUM(et) AS et_total, COUNT(et) AS et_total_num, SUM(uab) AS uab_total, COUNT(uab) AS uab_total_num, SUM(ubc) AS ubc_total, COUNT(ubc) AS ubc_total_num, SUM(uca) AS uca_total, COUNT(uca) AS uca_total_num, MAX(createtime) create_time, deviceid device_id FROM jetlinks.properties_ielectricityeeter WHERE (createTime >=? AND createTime <= ?) and _ts >= ? and ?>=_ts INTERVAL(1h) group by deviceid; ### Cause: java.sql.SQLException: Error ; uncategorized SQLException; SQL state [null]; error code [0]; Error; nested exception is java.sql.SQLException: Error at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441) at com.sun.proxy.$Proxy105.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:166) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:77) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) at com.sun.proxy.$Proxy106.getElectricityMeterHourInfo(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89) at com.hdtd.jetlinks.collect.framework.aspectj.DataSourceAspect.around(DataSourceAspect.java:43) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) at com.sun.proxy.$Proxy107.getElectricityMeterHourInfo(Unknown Source) at com.hdtd.jetlinks.collect.business.hourinfo.collect.service.impl.TaosElectricityMeterInfoServiceImpl.taosElectricityMeterInfoAddIotHourInfo(TaosElectricityMeterInfoServiceImpl.java:82) at com.hdtd.jetlinks.collect.business.hourinfo.collect.service.impl.TaosElectricityMeterInfoServiceImpl.taosElectricityMeterInfoAddIotHour(TaosElectricityMeterInfoServiceImpl.java:67) ... 6 more Caused by: java.sql.SQLException: Error at com.alibaba.druid.pool.DruidDataSource.handleConnectionException(DruidDataSource.java:1791) at com.alibaba.druid.pool.DruidPooledConnection.handleException(DruidPooledConnection.java:122) at com.alibaba.druid.pool.DruidPooledStatement.checkException(DruidPooledStatement.java:87) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:487) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59) at com.sun.proxy.$Proxy160.execute(Unknown Source) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:89) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:151) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:145) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427) ... 36 more Caused by: java.lang.NoSuchMethodError: com.alibaba.fastjson.JSONArray.getTimestamp(I)Ljava/lang/Object; at com.taosdata.jdbc.rs.RestfulResultSet.parseTimestampColumnData(RestfulResultSet.java:271) at com.taosdata.jdbc.rs.RestfulResultSet.parseColumnData(RestfulResultSet.java:184) at com.taosdata.jdbc.rs.RestfulResultSet.(RestfulResultSet.java:99) at com.taosdata.jdbc.rs.RestfulStatement.execute(RestfulStatement.java:88) at com.taosdata.jdbc.rs.RestfulPreparedStatement.execute(RestfulPreparedStatement.java:218) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:483) ... 57 more

JetLinks开源物联网平台基于Java8、Spring Boot 2.x、WebFlux、Netty、Vert.x、Reactor等开发,是一个开箱即用,可二次开发的企业级物联网基础平台。平台实现了物联网相关的众多基础功能,能帮助你快速建立物联网相关业务系统。 JetLinks开源物联网平台核心特性: 支持统一物模型管理,多种设备,多种厂家,统一管理。 统一设备连接管理,多协议适配(TCP、MQTT、UDP、CoAP、HTTP等),屏蔽网络编程复杂性,灵活接入不同厂家不同协议的设备。 灵活的规则引擎,设备告警,消息通知,数据转发。可基于SQL进行复杂的数据处理逻辑。 地理位置:统一管理地理位置信息,支持区域搜索。 数据可视化:实现拖拽配置数据图表,设备组态等。 JetLinks开源物联网平台技术栈: Spring Boot 2.2.x Spring WebFlux 响应式Web支持 R2DBC 响应式关系型数据库驱动 Project Reactor 响应式编程框架 Netty、Vert.x 高性能网络编程框架 ElasticSearch 全文检索,日志,时序数据存储 PostgreSQL 业务功能数据管理 hsweb framework 4 业务功能基础框架     JetLinks开源物联网平台 更新日志: v1.9 1、增加设备独立物模型支持,可给单独的设备配置物模型. 2、基本实现GB28181国标视频设备接入,支持直播,云台控制,级联操作.(选配模块) 3、RabbitMQ增加routeKey配置,可在配置文件中指定device.message.writer.rabbitmq.consumer-route-key和device.message.writer.rabbitmq.producer-route-key.(Pro) 4、当设置了device.message.writer.rabbitmq.consumer=false时,不创建MQ消费者.(Pro) 5、设备支持独立物模型,可单独配置设备的物模型. 6、适配tdengine 2.0.16.0,优化sql长度策略. (pro) 7、优化规则引擎编辑器,实现组件模块化动态加载.(Pro) 8、修复启动服务时,如果某个产品物模型发布失败,导致后面的产品终止发布的问题. 9、增加ignoreLatest消息头,message.addHeader("ignoreLatest",true) 忽略记录最新数据到数据库. 10、修复租户下操作设备告警提示无权限.(Pro) 11、优化租户在解绑成员时,同时解绑成员的资产信息.(Pro) 12、优化子设备消息回复处理 13、物模型属性增加存储方式功能,可配置部分属性不存储. 14、增加虚拟属性功能,可通过规则来计算出虚拟属性值.(Pro) 15、增加租户成员绑定(TenantMemberBindEvent),解绑(TenantMemberUnBindEvent)事件.可通过spring-event订阅处理此事件.(Pro) 16、优化子设备状态检查,当检查子设备状态时,将会尝试发送ChildDeviceMessage<DeviceStateCheckMessage>给网关,处理后返回ChildDeviceMessageReply<DeviceStateCheckMessageReply>. 17、增加ClickHouse设备数据存储策略支持.(Pro) 18、增加权限过滤功能,可配置禁止赋予自己没有的权限给其他用户.hsweb.permission.filter相关配置 19、设备和产品的租户绑定逻辑优化: 绑定设备时,自动绑定产品.解绑产品时,自动解绑设备.(Pro) 20、用户管理增加租户权限控制.(Pro) 21、当向keepOnline的设备发送消息时,如果原始连接已断开,将返回CONNECTION_LOST错误. 22、设置keepOnline的会话将被持久化,重启服务后自动恢复.(Pro) 23、默认关闭设备最新数据存储,通过jetlinks.device.storage.enable-last-data-in-db=true开启.(Pro) 24、属性物模型增加属性值来源,配置为手动时,在发送修改属性指令(WritePropertyMessage)时,将直接生效,不会发送到设备. 25、优化租户资产解绑逻辑,当删除数据时,解绑资产全部的绑定关系.(Pro) 26、用户管理,机构管理增加租户端支持,租户可以自己管理自己的用户和机构.(Pro)
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值