[#1354] - NPE in MondrianModel:528 when opening analysis view

Category:
Bug report
Priority:
High
Status:
Resolved
Project: Severity:
Major
Resolution:
Fixed
Component: Reproducibility:
Always
Assigned to:

A NullPointerException is thrown in java.com.tonbeller.jpivot.mondrian.MondrianModel.java, line 528, when opening any(?)
Analysis view, due to locale==null.

The following line is probably incorrect:
if (modelLocale != null) {
if (logInfo) {
String msg = "Locale language=" +
locale.getLanguage() + " Country=" +
locale.getCountry();
logger.info(msg);
} ....
After checking /modelLocale/ for not null, /locale/ is referenced instead for logging output, which results in NPE in my setup.

Exception log:
com.jaspersoft.jasperserver.api.JSException: java.lang.NullPointerException
at com.jaspersoft.jasperserver.war.control.OlapModelController.getOlapSession(OlapModelController.java:399)
at com.jaspersoft.jasperserver.war.control.OlapModelController.viewOlap(OlapModelController.java:178)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...

Caused by: java.lang.NullPointerException
at com.tonbeller.jpivot.mondrian.MondrianModel.initialize(MondrianModel.java:528)
at com.tonbeller.jpivot.olap.model.OlapModelDecorator.initialize(OlapModelDecorator.java:132)
at com.tonbeller.jpivot.tags.OlapModelProxy$MyState.initialize(OlapModelProxy.java:77)
at com.tonbeller.jpivot.tags.PageStateManager.initializeAndShow(PageStateManager.java:42)
at com.tonbeller.jpivot.tags.OlapModelProxy.initializeAndShow(OlapModelProxy.java:179)
at com.jaspersoft.jasperserver.api.metadata.olap.service.impl.OlapConnectionServiceImpl.initializeAndShow(
OlapConnectionServiceImpl.java:335)
at com.jaspersoft.jasperserver.war.control.OlapModelController.getOlapSession(OlapModelController.java:396)

Sebastian Brandt: 08/28/2007 4:23 AM PDT
Comment:

After changing the line to read
String msg = "Locale language=" + modelLocale.getLanguage() + " Country=" + modelLocale.getCountry();
the analysis views work again.
(jasperjpivot-2.0.1-src, jpivot-2.0.1.jar)

My setup:
JBoss 4.0.4
jasperserver-2.0.1, unpacked war
firebird 2.0.1 (various patches in jasperserver-repository-hibernate-2.0.1.jar to work with this DB instead of mysql)
Locale language=de Country=DE

Action: Update

tcloonan's picture
1597
Joined: Dec 22 2006 - 1:13am
Last seen: 15 years 4 months ago
Feedback
randomness