Exception in Organistation unit chart report

Bug #626630 reported by Thuy Nguyen on 2010-08-30
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Thu Tran

Bug Description

When I create a organisation unit chart report, it generate fine. But when I edit it by change other indicator or uncheck the one of the check box,.. then I can't save that report anymore because it always generate Exception like this
An exception occurred

Sorry! The system failed to execute the operation. Usually, no data is lost and you can continue working by going back to the previous page. If you wish to report the incident, please save this page by choosing "File -> Save (page as)" in your browser and include the saved page in the report. The problem details are listed below.

[-] Exception (java.lang.ArrayIndexOutOfBoundsException): 1

    * org.hisp.dhis.period.Period.(Period.java:97)
    * org.hisp.dhis.period.DefaultPeriodService.getPeriodByExternalId(DefaultPeriodService.java:107)
    * org.hisp.dhis.period.DefaultPeriodService.getPeriodsByExternalIds(DefaultPeriodService.java:116)
    * sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)


Ola Hodne Titlestad (olatitle) wrote :
Download full text (10.7 KiB)

Seems to be a problem with the period when editing the chart.
Here is what I did:
1)Created a new orgunit chart with an aggregated period (jan-march 2010) and the chart was ok.
2) Edited the chart to rename the name of the chart and saved, and then I got the exception.

See log below:

* INFO 09:25:54,818 Viewing chart: ANC3 coverage by district - Q1 2010, width: 1000, height: 500 (ViewChartAction.java
* INFO 09:25:55,783 Initialising statement manager (StatementInterceptor.java [890594303@qtp-169937755-0])
* INFO 09:25:56,421 Destroying statement manager (StatementInterceptor.java [890594303@qtp-169937755-0])
* INFO 09:25:56,423 Viewing chart: ANC3 coverage by district - Q1 2010, width: 1000, height: 500 (ViewChartAction.java
* INFO 09:26:11,998 Sat item '1' on area 'chartAreaA' (SetAreaItemAction.java [890594303@qtp-169937755-0])
* INFO 09:26:12,209 Initialising statement manager (StatementInterceptor.java [1641427189@qtp-169937755-10])
* INFO 09:26:12,936 Destroying statement manager (StatementInterceptor.java [1641427189@qtp-169937755-10])
* ERROR 09:26:40,220 Error while executing action (ExceptionInterceptor.java [1641427189@qtp-169937755-10])
java.lang.ArrayIndexOutOfBoundsException: 1
        at org.hisp.dhis.period.Period.<init>(Period.java:97)
        at org.hisp.dhis.period.DefaultPeriodService.getPeriodByExternalId(DefaultPeriodService.java:108)
        at org.hisp.dhis.period.DefaultPeriodService.getPeriodsByExternalIds(DefaultPeriodService.java:117)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy15.getPeriodsByExternalIds(Unknown Source)
        at org.hisp.dhis.reporting.chart.action.SaveChartAction.execute(SaveChartAction.java:263)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.in...

Changed in dhis2:
importance: Undecided → High
milestone: none → 2.0.5
Ola Hodne Titlestad (olatitle) wrote :

An update.

The problem is related to the aggregated periods which I guess are not persisted in the system.

The first time a chart with an aggregated period is generated everything is fine. Any update to this chart (keeping the same aggregated period) end up with this exception.

Changing the period to a monthly (existing period) works fine, also when editing charts, so it looks like there is something wrong with the way the system looks up the aggregated period when it is "reused", as in the chart name or indicators are edited.

Changed in dhis2:
assignee: nobody → Thu Tran (tran-hispvietnam)
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers