在开发服务器正常执行 ,在测试服务器报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