[ 
https://issues.apache.org/jira/browse/WW-3348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart closed WW-3348.
-----------------------------

    Resolution: Not a Problem

Please retest with the latest 2.3.17 version

> IndexOutOfBoundsException in ValueStackDataSource
> -------------------------------------------------
>
>                 Key: WW-3348
>                 URL: https://issues.apache.org/jira/browse/WW-3348
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JasperReports
>    Affects Versions: 2.1.8
>         Environment: WinXP, Tomcat
>            Reporter: Mark Gorokhov
>             Fix For: 2.3.18
>
>
> Scenario: 
>   - Jasper report with 4 subreports. 
>   - Subreports content is provided from 
> org.apache.struts2.views.jasperreports.ValueStackDataSource
> Exception 
>    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
> is thrown from org.apache.struts2.views.jasperreports.ValueStackDataSource:
>     public boolean next() throws JRException {
>         if (firstTimeThrough) {
>             firstTimeThrough = false;
>         } else {
>             valueStack.pop(); <== throws exception
>         }
>         . . .
>     }
> Exception is thrown if the last row from subreport fits the current page and 
> a new page is started. Thus the exception is data dependent.
> The following workaround works nicely:
>     public boolean next() throws JRException {
>         if (firstTimeThrough) {
>             firstTimeThrough = false;
>         } else {
>             if (valueStack.size() > 0) {
>                 valueStack.pop();
>             }
>         }
>         . . .
>     }
> Please test and implement in the next release.
> The following does not work (main report is generated partially, stops on 
> empty valueStack condition):
>     public boolean next() throws JRException {
>         if (firstTimeThrough) {
>             firstTimeThrough = false;
>         } else {
>             if (valueStack.size() == 0) {
>                 return false;
>             }
>             valueStack.pop();
>         }
>         . . .
>     }



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to