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

QQ登录

只需一步,快速开始

查看: 1244|回复: 2

[结贴] X5版本升级之后,报表执行报错问题

[复制链接]

86

主题

299

帖子

576

积分

高级会员

Rank: 4

积分
576
QQ
发表于 2013-7-24 17:51:19 | 显示全部楼层 |阅读模式
X5.2.3版本升级到X5.2.5版本之后发现同一报表页面执行出错问题,在X5.2.3版本下实现“专家分数评定报表”页面,没有出现问题,结果如下图1所示。
升级到X5.2.5版本之后测试发现该页面执行出错,如下图2所示。
控制台信息如下:
  1. at java.lang.Thread.run(Thread.java:662)
  2. Caused by: java.lang.reflect.InvocationTargetException
  3. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  4. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  5. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  6. at java.lang.reflect.Method.invoke(Method.java:597)
  7. at com.justep.system.action.Engine.invokeActions(Native Method)
  8. ... 21 more
  9. Caused by: com.justep.model.exception.ModelException: 执行sqlQueryAction时报错!select EI.Name as Name,ISNULL(ES.ExpertRolesName,'未担任评审职务') as ExpertRoles,isnull(ES.ExpertScore, '0') as score,count(ES.ExpertRolesName) as count,isnull(ExpertScore*count(*), '0') as Total from ExpertReview ER right outer join ExpertInformation EI on EI.Name = ER.ExpertName left outer join ExpertSetscoreMess ES on ER.RevPosition = ES.ExpertRolesName WHERE 1=1 and ER.ReviewDate BETWEEN CAST('null' AS DATETIME) and CAST('null' AS DATETIME) group by Name, ES.ExpertRolesName, ES.ExpertScore order by EI.Name, ES.ExpertRolesName desc
  10. at com.justep.system.data.SQL.select(Unknown Source)
  11. at com.justep.system.data.SQL.select(Unknown Source)
  12. at Kyglxt.expertScoreReview(Kyglxt.java:147)
  13. ... 26 more
  14. Caused by: java.sql.SQLException: 从字符串转换日期和/或时间时,转换失败。
  15. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
  16. at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
  17. at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
  18. at net.sourceforge.jtds.jdbc.TdsCore.isDataInResultSet(TdsCore.java:792)
  19. at net.sourceforge.jtds.jdbc.JtdsResultSet.<init>(JtdsResultSet.java:146)
  20. at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:424)
  21. at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:693)
  22. at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
  23. at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
  24. ... 29 more
  25. 2013-07-24 17:47:14 excute Action error:<?xml version="1.0" encoding="UTF-8"?>
  26. <action direct-execute="true" process="/kygl/kyglxt/process/expertScoreRevReport/expertScoreRevReportProcess" activity="mainActivity" action-flag="__action_0__" executor="" execute-context="" name="expertScoreReviewAction"><parameters xmlns:xbiz="http://www.justep.com/xbiz#"></parameters></action>
  27. com.justep.model.exception.ModelException: java.lang.reflect.InvocationTargetException
  28. at com.justep.system.action.Engine.invokeActions(Unknown Source)
  29. at com.justep.business.server.BusinessServer.doAction(Unknown Source)
  30. at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
  31. at com.justep.business.server.BusinessServer.excute(Unknown Source)
  32. at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
  33. at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
  34. at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  35. at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
  36. at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  37. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  38. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  39. at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  40. at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  41. at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  42. at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  43. at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  44. at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
  45. at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
  46. at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
  47. at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  48. at java.lang.Thread.run(Thread.java:662)
  49. Caused by: java.lang.reflect.InvocationTargetException
  50. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  51. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  52. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  53. at java.lang.reflect.Method.invoke(Method.java:597)
  54. at com.justep.system.action.Engine.invokeActions(Native Method)
  55. ... 21 more
  56. Caused by: com.justep.model.exception.ModelException: 执行sqlQueryAction时报错!select EI.Name as Name,ISNULL(ES.ExpertRolesName,'未担任评审职务') as ExpertRoles,isnull(ES.ExpertScore, '0') as score,count(ES.ExpertRolesName) as count,isnull(ExpertScore*count(*), '0') as Total from ExpertReview ER right outer join ExpertInformation EI on EI.Name = ER.ExpertName left outer join ExpertSetscoreMess ES on ER.RevPosition = ES.ExpertRolesName WHERE 1=1 and ER.ReviewDate BETWEEN CAST('null' AS DATETIME) and CAST('null' AS DATETIME) group by Name, ES.ExpertRolesName, ES.ExpertScore order by EI.Name, ES.ExpertRolesName desc
  57. at com.justep.system.data.SQL.select(Unknown Source)
  58. at com.justep.system.data.SQL.select(Unknown Source)
  59. at Kyglxt.expertScoreReview(Kyglxt.java:147)
  60. ... 26 more
  61. Caused by: java.sql.SQLException: 从字符串转换日期和/或时间时,转换失败。
  62. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
  63. at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
  64. at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
  65. at net.sourceforge.jtds.jdbc.TdsCore.isDataInResultSet(TdsCore.java:792)
  66. at net.sourceforge.jtds.jdbc.JtdsResultSet.<init>(JtdsResultSet.java:146)
  67. at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:424)
  68. at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:693)
  69. at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
  70. at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
  71. ... 29 more
  72. [ERROR] 2013-07-24 17:47:14,182 com.justep.report.controller.DataController - 报表数据获取失败
  73. 执行sqlQueryAction时报错!select EI.Name as Name,ISNULL(ES.ExpertRolesName,'未担任评审职务') as ExpertRoles,isnull(ES.ExpertScore, '0') as score,count(ES.ExpertRolesName) as count,isnull(ExpertScore*count(*), '0') as Total from ExpertReview ER right outer join ExpertInformation EI on EI.Name = ER.ExpertName left outer join ExpertSetscoreMess ES on ER.RevPosition = ES.ExpertRolesName WHERE 1=1 and ER.ReviewDate BETWEEN CAST('null' AS DATETIME) and CAST('null' AS DATETIME) group by Name, ES.ExpertRolesName, ES.ExpertScore order by EI.Name, ES.ExpertRolesName desc
  74. com.justep.report.exception.ReportServerException: 报表数据获取失败
  75. at com.justep.report.controller.DataController.execute(Unknown Source)
  76. at com.justep.report.controller.GenericControllerChain.execute(Unknown Source)
  77. at com.justep.report.controller.InitController.execute(Unknown Source)
  78. at com.justep.report.controller.GenericControllerChain.execute(Unknown Source)
  79. at com.justep.report.Servlet.a(Unknown Source)
  80. at com.justep.report.Servlet.doPost(Unknown Source)
  81. at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
  82. at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  83. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  84. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  85. at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  86. at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  87. at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  88. at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  89. at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  90. at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
  91. at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
  92. at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
  93. at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  94. at java.lang.Thread.run(Thread.java:662)
  95. Caused by: com.justep.report.exception.ReportServerException: 执行sqlQueryAction时报错!select EI.Name as Name,ISNULL(ES.ExpertRolesName,'未担任评审职务') as ExpertRoles,isnull(ES.ExpertScore, '0') as score,count(ES.ExpertRolesName) as count,isnull(ExpertScore*count(*), '0') as Total from ExpertReview ER right outer join ExpertInformation EI on EI.Name = ER.ExpertName left outer join ExpertSetscoreMess ES on ER.RevPosition = ES.ExpertRolesName WHERE 1=1 and ER.ReviewDate BETWEEN CAST('null' AS DATETIME) and CAST('null' AS DATETIME) group by Name, ES.ExpertRolesName, ES.ExpertScore order by EI.Name, ES.ExpertRolesName desc
  96. at com.justep.report.controller.DataController.a(Unknown Source)
  97. at com.justep.report.controller.DataController.a(Unknown Source)
  98. ... 20 more
  99. Caused by: java.lang.Exception
  100. ... 22 more
复制代码

1

1

2

2

86

主题

299

帖子

576

积分

高级会员

Rank: 4

积分
576
QQ
 楼主| 发表于 2013-7-24 17:55:29 | 显示全部楼层
该功能页面相关代码如下:
public static Table expertScoreReview(String begindate, String enddate) {
                String oracle = "select EI.Name as Name,ISNULL(ES.ExpertRolesName,'未担任评审职务') as ExpertRoles,isnull(ES.ExpertScore, '0') as score,count(ES.ExpertRolesName) as count,isnull(ExpertScore*count(*), '0') as Total from ExpertReview ER right outer join ExpertInformation EI on EI.Name = ER.ExpertName left outer join ExpertSetscoreMess ES on ER.RevPosition = ES.ExpertRolesName";
                String mssql = "select EI.Name as Name,ISNULL(ES.ExpertRolesName,'未担任评审职务') as ExpertRoles,isnull(ES.ExpertScore, '0') as score,count(ES.ExpertRolesName) as count,isnull(ExpertScore*count(*), '0') as Total from ExpertReview ER right outer join ExpertInformation EI on EI.Name = ER.ExpertName left outer join ExpertSetscoreMess ES on ER.RevPosition = ES.ExpertRolesName";
                oracle += " WHERE 1=1 ";
                mssql += " WHERE 1=1 ";
                if (!"".equals(begindate) && !"".equals(enddate)) {
                        oracle += "and ER.ReviewDate BETWEEN CAST('" + begindate + "' AS DATETIME) and CAST('" + enddate + "' AS DATETIME) ";
                        mssql += "and ER.ReviewDate BETWEEN CAST('" + begindate + "' AS DATETIME) and CAST('" + enddate + "' AS DATETIME) ";
                }
                oracle += "group by Name, ES.ExpertRolesName, ES.ExpertScore order by EI.Name, ES.ExpertRolesName desc";
                mssql += " group by Name, ES.ExpertRolesName, ES.ExpertScore order by EI.Name, ES.ExpertRolesName desc";
                HashMap<String, String> sqlMap = new HashMap<String, String>();
                sqlMap.put("ORACLE", oracle);
                sqlMap.put("MSSQL", mssql);

                return SQL.select(sqlMap, null, "/kygl/kyglxt/data");
        }
回复 支持 反对

使用道具 举报

86

主题

299

帖子

576

积分

高级会员

Rank: 4

积分
576
QQ
 楼主| 发表于 2013-7-24 18:32:02 | 显示全部楼层
是我这边查询SQL语句有问题,修改之后就好了。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-6 18:45 , Processed in 0.098342 second(s), 26 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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