起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1797|回复: 4

[结贴] KSQL报错

[复制链接]

133

主题

496

帖子

931

积分

高级会员

Rank: 4

积分
931
QQ
发表于 2014-5-21 10:50:32 | 显示全部楼层 |阅读模式
版本: X5.2.5 小版本号: 2393
数据库: MySQL 服务器操作系统: 应用服务器: Tomcat
客户端操作系统: 浏览器:
执行KSQL报错,错误信息如下:
  1. 2014-05-21 10:46:02 invokeActions error!
  2. com.justep.model.exception.ModelException: java.lang.reflect.InvocationTargetException
  3.         at com.justep.system.action.Engine.invokeActions(Unknown Source)
  4.         at com.justep.business.server.BusinessServer.doAction(Unknown Source)
  5.         at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
  6.         at com.justep.business.server.BusinessServer.excute(Unknown Source)
  7.         at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
  8.         at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
  9.         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  10.         at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
  11.         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  12.         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  13.         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  14.         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  15.         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  16.         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  17.         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  18.         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  19.         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
  20.         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
  21.         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
  22.         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  23.         at java.lang.Thread.run(Thread.java:595)
  24. Caused by: java.lang.reflect.InvocationTargetException
  25.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  26.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  27.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  28.         at java.lang.reflect.Method.invoke(Method.java:592)
  29.         at com.justep.system.action.Engine.invokeActions(Native Method)
  30.         ... 21 more
  31. Caused by: com.justep.model.exception.ModelException: 执行ksql:select st.* from SA_CeyuWorkTask st where DATE_ADD(st.fCeyuWorkTaskDeadline,INTERVAL 1 DAY) = '2014-05-21' AND st.fCeyuWorkTaskStatus = 'no' 时出错!
  32.         at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
  33.         at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
  34.         at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
  35.         at com.justep.system.data.KSQL.select(Unknown Source)
  36.         at Zhigao.sendMessageForWorkTask(Zhigao.java:247)
  37.         ... 26 more
  38. Caused by: com.justep.system.ksql.matcher.TokenMatchException: dline,INTERVAL ^^1 DAY) = '2014- 中未找到需要的token, 位置:85 需要下列之一:)
  39.         at com.justep.system.ksql.token.TokenManager.matchToken(Unknown Source)
  40.         at com.justep.system.ksql.token.TokenManager.match(Unknown Source)
  41.         at com.justep.system.ksql.parser.AbstractParser.functionExpression(Unknown Source)
  42.         at com.justep.system.ksql.parser.AbstractParser.unaryExpression(Unknown Source)
  43.         at com.justep.system.ksql.parser.AbstractParser.multiExpression(Unknown Source)
  44.         at com.justep.system.ksql.parser.AbstractParser.addExpression(Unknown Source)
  45.         at com.justep.system.ksql.parser.AbstractParser.compExpression(Unknown Source)
  46.         at com.justep.system.ksql.parser.AbstractParser.notExpression(Unknown Source)
  47.         at com.justep.system.ksql.parser.AbstractParser.andExpression(Unknown Source)
  48.         at com.justep.system.ksql.parser.AbstractParser.orExpression(Unknown Source)
  49.         at com.justep.system.ksql.parser.AbstractParser.conditionExpression(Unknown Source)
  50.         at com.justep.system.ksql.parser.AbstractParser.whereExpression(Unknown Source)
  51.         at com.justep.system.ksql.parser.AbstractParser.selectSentenceNode(Unknown Source)
  52.         at com.justep.system.ksql.parser.QueryParser.start(Unknown Source)
  53.         at com.justep.system.ksql.parser.QueryParser.start(Unknown Source)
  54.         at com.justep.system.ksql.parser.AbstractParser.parse(Unknown Source)
  55.         ... 31 more
  56. 2014-05-21 10:46:02 excute Action error:<?xml version="1.0" encoding="UTF-8"?>
  57. <action process="/SA/zhigao/process/CeyuWorkTask/ceyuWorkTaskProcess" activity="mainActivity" name="sendMessageForWorkTaskAction" executeContext="" content-type="application/xml"><parameters/></action>
  58. com.justep.model.exception.ModelException: java.lang.reflect.InvocationTargetException
  59.         at com.justep.system.action.Engine.invokeActions(Unknown Source)
  60.         at com.justep.business.server.BusinessServer.doAction(Unknown Source)
  61.         at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
  62.         at com.justep.business.server.BusinessServer.excute(Unknown Source)
  63.         at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
  64.         at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
  65.         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  66.         at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
  67.         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  68.         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  69.         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  70.         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  71.         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  72.         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  73.         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  74.         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  75.         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
  76.         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
  77.         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
  78.         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  79.         at java.lang.Thread.run(Thread.java:595)
  80. Caused by: java.lang.reflect.InvocationTargetException
  81.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  82.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  83.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  84.         at java.lang.reflect.Method.invoke(Method.java:592)
  85.         at com.justep.system.action.Engine.invokeActions(Native Method)
  86.         ... 21 more
  87. Caused by: com.justep.model.exception.ModelException: 执行ksql:select st.* from SA_CeyuWorkTask st where DATE_ADD(st.fCeyuWorkTaskDeadline,INTERVAL 1 DAY) = '2014-05-21' AND st.fCeyuWorkTaskStatus = 'no' 时出错!
  88.         at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
  89.         at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
  90.         at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
  91.         at com.justep.system.data.KSQL.select(Unknown Source)
  92.         at Zhigao.sendMessageForWorkTask(Zhigao.java:247)
  93.         ... 26 more
  94. Caused by: com.justep.system.ksql.matcher.TokenMatchException: dline,INTERVAL ^^1 DAY) = '2014- 中未找到需要的token, 位置:85 需要下列之一:)
  95.         at com.justep.system.ksql.token.TokenManager.matchToken(Unknown Source)
  96.         at com.justep.system.ksql.token.TokenManager.match(Unknown Source)
  97.         at com.justep.system.ksql.parser.AbstractParser.functionExpression(Unknown Source)
  98.         at com.justep.system.ksql.parser.AbstractParser.unaryExpression(Unknown Source)
  99.         at com.justep.system.ksql.parser.AbstractParser.multiExpression(Unknown Source)
  100.         at com.justep.system.ksql.parser.AbstractParser.addExpression(Unknown Source)
  101.         at com.justep.system.ksql.parser.AbstractParser.compExpression(Unknown Source)
  102.         at com.justep.system.ksql.parser.AbstractParser.notExpression(Unknown Source)
  103.         at com.justep.system.ksql.parser.AbstractParser.andExpression(Unknown Source)
  104.         at com.justep.system.ksql.parser.AbstractParser.orExpression(Unknown Source)
  105.         at com.justep.system.ksql.parser.AbstractParser.conditionExpression(Unknown Source)
  106.         at com.justep.system.ksql.parser.AbstractParser.whereExpression(Unknown Source)
  107.         at com.justep.system.ksql.parser.AbstractParser.selectSentenceNode(Unknown Source)
  108.         at com.justep.system.ksql.parser.QueryParser.start(Unknown Source)
  109.         at com.justep.system.ksql.parser.QueryParser.start(Unknown Source)
  110.         at com.justep.system.ksql.parser.AbstractParser.parse(Unknown Source)
  111.         ... 31 more
  112. java.lang.RuntimeException: 执行ksql:select st.* from SA_CeyuWorkTask st where DATE_ADD(st.fCeyuWorkTaskDeadline,INTERVAL 1 DAY) = '2014-05-21' AND st.fCeyuWorkTaskStatus = 'no' 时出错!
  113.         at X5Actions.sendMessageForWorkTask(X5Actions.java:108)
  114.         at DemoTask.doSomething(DemoTask.java:18)
  115.         at DemoTask.run(DemoTask.java:51)
  116.         at java.util.TimerThread.mainLoop(Timer.java:512)
  117.         at java.util.TimerThread.run(Timer.java:462)
复制代码

133

主题

496

帖子

931

积分

高级会员

Rank: 4

积分
931
QQ
 楼主| 发表于 2014-5-21 10:55:32 | 显示全部楼层
补充下:应该是 DATE_ADD(st.fCeyuWorkTaskDeadline,INTERVAL 1 DAY) 这个函数出错了,KSQL不能用这个函数吗?
回复 支持 反对

使用道具 举报

58

主题

410

帖子

823

积分

高级会员

Rank: 4

积分
823
QQ
发表于 2014-5-21 10:59:06 | 显示全部楼层
参考api ksql不支持

评分

参与人数 1 +2 收起 理由
jishuang + 2 赞一个!

查看全部评分

回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36067
发表于 2014-5-21 11:02:06 | 显示全部楼层
KSQL中不支持DATE_ADD,可以用SQL.调用数据库本地函数
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

133

主题

496

帖子

931

积分

高级会员

Rank: 4

积分
931
QQ
 楼主| 发表于 2014-5-21 11:06:38 | 显示全部楼层
谢谢~
我用java获取当前日期的前一天,sql语句里就不用日期函数了
  1. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  2.                 Date date = new Date();
  3.                 Calendar calendar = Calendar.getInstance();
  4.                 calendar.setTime(date);
  5.                 calendar.add(Calendar.DAY_OF_MONTH, -1);
  6.                 date = calendar.getTime();
  7.                 String lastDay = sdf.format(date);
复制代码
结贴吧~
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-11-23 04:42 , Processed in 0.078043 second(s), 26 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表