@JFinal 在用Db.paginate(pageNumber, pageSi?400报错-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

@JFinal 在用Db.paginate(pageNumber, pageSi?400报错

爱吃鱼的程序员 2020-06-06 09:20:56 98

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
 

分享到
取消 提交回答
全部回答(1)
  • 爱吃鱼的程序员
    2020-06-06 09:21:07
                        <p>引入一个中间变量,然后再传入 paginate 方法,或者强制类型转换为 (Object)para</p>
                    
    
                            您好,发现是SQL语句中加入 GROUP BY 的问题
                        
    
                            嗯嗯,谢谢,我试试
    
    0 0
云计算
使用钉钉扫一扫加入圈子
+ 订阅

时时分享云计算技术内容,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。

推荐文章