@JFinal 在用Db.paginate(pageNumber, pageSize, sqls,sql)时报错[Ljava.lang.Object; cannot be cast to java.lang.Number
com.jfinal.plugin.activerecord.ActiveRecordException: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.lang.Number
at com.jfinal.plugin.activerecord.DbPro.doPaginate(DbPro.java:537)
at com.jfinal.plugin.activerecord.DbPro.paginate(DbPro.java:521)
at com.jfinal.plugin.activerecord.Db.paginate(Db.java:440)
at com.ymm.project.model.statistics.Statistics.queryByPage(Statistics.java:44)
at com.ymm.project.controller.statistics.StatisticsController.index(StatisticsController.java:23)
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.jfinal.aop.Invocation.invoke(Invocation.java:75)
at com.ymm.project.base.LoginInterceptor.intercept(LoginInterceptor.java:16)
at com.jfinal.aop.Invocation.invoke(Invocation.java:69)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:81)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.lang.Number
at com.jfinal.plugin.activerecord.DbPro.doPaginateByFullSql(DbPro.java:561)
at com.jfinal.plugin.activerecord.DbPro.doPaginate(DbPro.java:535)
... 32 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
嗯嗯,谢谢,我试试
您好,发现是SQL语句中加入 GROUP BY 的问题
引入一个中间变量,然后再传入 paginate 方法,或者强制类型转换为 (Object)para