Grails - ERROR errors.GrailsExceptionResolver - 无法导航到下一页

时间:2015-09-21 12:56:54

标签: grails gorm grails-2.0 grails-domain-class grails-controller

在下面显示的图片中(本帖末尾),我无法导航到网页中的下一页。

如果我点击下一页:我收到错误:ToIndex - 11

错误消息:

 grails> | Error 2015-09-21 18:04:21,491 [http-bio-8080-exec-2] ERROR errors.GrailsExceptionResolver  - IndexOutOfBoundsException occurred when processing request: [POST] /clindata/dailyJobActivity/show - parameters:
    id: 402
    sort: id
    max: 10
    order: asc
    name: 
    action: show
    controller: dailyJobActivity
    offset: 10
    user: Clindata admin
    toIndex = 11. Stacktrace follows:
    Message: toIndex = 11
        Line | Method
    ->>  962 | subListRangeCheck in java.util.ArrayList
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    |    954 | subList           in     ''
    |     42 | doCall . . . . .  in com.datumrite.SecurityFilters$_closure1_closure3_closure9
    |    195 | doFilter          in grails.plugin.cache.web.filter.PageFragmentCachingFilter
    |     63 | doFilter . . . .  in grails.plugin.cache.web.filter.AbstractFilter
    |   1145 | runWorker         in java.util.concurrent.ThreadPoolExecutor
    |    615 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
    ^    745 | run               in java.lang.Thread
    grails> Exception:org.codehaus.groovy.grails.web.errors.GrailsWrappedRuntimeException: toIndex = 11 
     isXhr:true 
     Inspect: org.codehaus.groovy.grails.web.errors.GrailsWrappedRuntimeException: toIndex = 11 
     Dump:<org.codehaus.groovy.grails.web.errors.GrailsWrappedRuntimeException@2e4840 className=SecurityFilters lineNumber=42 stackTrace=java.lang.IndexOutOfBoundsException: toIndex = 11
        at java.util.ArrayList.subListRangeCheck(ArrayList.java:962)
        at java.util.ArrayList.subList(ArrayList.java:954)
        at com.datumrite.SecurityFilters$_closure1_closure3_closure9.doCall(SecurityFilters.groovy:42)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
     codeSnippet=[] gspFile=null cause=java.lang.IndexOutOfBoundsException: toIndex = 11 resolver=org.springframework.core.io.support.PathMatchingResourcePatternResolver@89765b stackTraceLines=[java.lang.IndexOutOfBoundsException: toIndex = 11
    ,   at java.util.ArrayList.subListRangeCheck(ArrayList.java:962)
    ,   at java.util.ArrayList.subList(ArrayList.java:954)
    ,   at com.datumrite.SecurityFilters$_closure1_closure3_closure9.doCall(SecurityFilters.groovy:42)
    ,   at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
    ,   at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
    ,   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    ,   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    ,   at java.lang.Thread.run(Thread.java:745)
    ] fileName=SecurityFilters.groovy detailMessage=toIndex = 11 cause=java.lang.IndexOutOfBoundsException: toIndex = 11 stackTrace=[] suppressedExceptions=[]>

查看页面:

<g:set var="title" value="Data Processing Log" />
<g:applyLayout name="form">
  <content tag="body"> 
  <table border="0" cellpadding="0" cellspacing="0" class="tablesorter">
                <thead>
                    <tr>
                        <th>Job Id</th>
                        <th>Job</th>
                        <th>Task</th>
                        <th>Activity Description</th>
                        <th>Date</th>
                        <th>Status</th>
                        <th>Message</th> 
                        <th>Error Code</th>
                    </tr>
                </thead>
                <tbody>
                    <g:each in="${data}">
                        <tr>
                            <td>${it?.daily_job.id}</td>
                            <td>${it?.job}</td>
                            <td>${it?.task}</td>
                            <td>${it?.activity}</td>
                            <td><g:formatDate format="MMM dd, yyyy HH:mm" date="${it?.activity_datetime}"/></td>
                            <td>${it?.status}</td>
                            <td>

                            <g:if test="${it?.message.size() > 80}">
                            ${it?.message.substring(0,80)}...
                            </g:if>
                            <g:else>
                            ${it?.message}
                            </g:else>

                            </td>
                            <td>${it?.error_code}</td>
                        </tr>
                    </g:each>
                </tbody>
            </table>
   </content>
</g:applyLayout>

控制器:

package com.datumrite.sdtm
import java.text.SimpleDateFormat;
import com.datumrite.master.*;
import com.datumrite.BaseController
import com.datumrite.sdtm.Dailyjob


@Mixin(BaseController)
class DailyJobActivityController {
    def commonService;
    def view_name='/dataManagement/DailyJob'
    def protoId 
    def providerId
    def index() { }

    def show(){
         System.out.println "=== Activity ===";
        def data = []
        def myCount = 0
        Integer max = params.max ? params.int("max") : 10
        Integer offset = params.offset ? params.int("offset") : 0
        def job = Dailyjob.get(params.id as Long);
        myCount = Dailyjobactivity.where {  
        daily_job == job  
        }.count()
        data = Dailyjobactivity.where { 
        daily_job == job  
        }.list([sort:'activity_datetime',order:'desc', max: max, offset: offset])
        System.out.println "=== Data activity ==="+data.size();
        render(view:view_name+'/jobactivity',model:[data:data,instanceTotal:myCount,remotePagination: true])
    } 
}

enter image description here

在此图片中,我无法导航到下一页..收到上面显示的错误。

有人可以帮忙吗?提前致谢

0 个答案:

没有答案
相关问题