Opened 2 years ago

Last modified 2 years ago

#357 new Issue

Using <ADD_MISSING_QUERY_RESULT_RECORDS><ALL_FLAG/> in query configuration throws uncaught exception

Reported by: Paul Leo Owned by:
Priority: +Medium Milestone: Needs Analysis
Component: View-App Version: 2.3
Severity: Unknown Keywords:
Cc:

Description (last modified by Lois Haggard)

In one of Hawaii's query modules Drugs1MonthBefPreg.xml, using ADD_MISSING_QUERY_RESULT_RECORDS, throws an uncaught error if DISPLAY BY is set to Geography (County) and Group By is set to year, and Year has been filtered to 2013, 2012 and 2011. The XML returned by ibisq seems correct (according to Garth, but it needs more review). There also are no missing rows for this query returned by IBISQ to ibisph-view (not sure if that makes a difference, but the AddMissiqQueryResultRecordsToQueryModule? would not have to add any missing records to the query results for this query).

If you filter by other years e.g (2012, 2011, 2010), the query works. If <ADD_MISSING_QUERY_RESULT_RECORDS><ALL_FLAG/> </ADD_MISSING_QUERY_RESULT_RECORDS> is commented out and the same query that throws the error is run, the results page comes up fine and all rows/columns on the results page are populated.

An additional issue is that AddMissingQueryResultRecordsToQueryModule?.java doesn't seem to be showing debug statements in the log file when logback is set to debug for that java code.

The following steps may be used to reproduce the error:

  1. Use the following query module from Hawaii: https://trac.ibisph.org/trac/browser/main/adopters/hi/branches/2.3/src/main/webapps/ibisph-view-content/xml/query/module/prams/Drugs1MonthBefPreg.xml
  2. Un-comment <ADD_MISSING_QUERY_RESULT_RECORDS><ALL_FLAG/> </ADD_MISSING_QUERY_RESULT_RECORDS> on lines 75 and 178 of Drugs1MonthBefPreg.xml
  3. You will need a valid SAS data file for Hawaii PRAMS
  4. Run the Drugs1MonthBefPreg_CNTY query configuration using a URL similar to the following in a local development environment; loading the query builder URL: http://localhost:8080/ibisph-view/query/builder/prams/Drugs1MonthBefPreg/Drugs1MonthBefPreg_CNTY.html (NOTE: the query configuration name may change - there are 2 configurations in this file one for state and one for county, use the one for county)
  5. Take the default for Steps 1 and 2 (Yes, County)
  6. In step 3 verify only the following years are selected 2013, 2012, 2011 (this is the default)
  7. Skip steps 4, 5, and 6.
  8. Go to step 7 set the:
    1. Display By to Geography (the default)
    2. Group By to Year
  9. click submit

After IBISQ is done running and the XML results are passed back to ibisph-view, the error will be thrown

The stack trace is as follows: java.lang.NullPointerException?

at

org.ibisph.querymodule.modelmap.AddMissingQueryResultRecordsToQueryModule?

.buildQueryResultRecordElements(AddMissingQueryResultRecordsToQueryModule?.java:233)

at

org.ibisph.querymodule.modelmap.AddMissingQueryResultRecordsToQueryModule?.processModelMap

(AddMissingQueryResultRecordsToQueryModule?.java:119)

at

org.ibisph.web.springmvc.ModelMapListProcessingController?.getModelMap

(ModelMapListProcessingController?.java:123)

at

org.ibisph.web.springmvc.ModelMapAndViewController?.handleRequestInternal

(ModelMapAndViewController?.java:98)

at org.springframework.web.servlet.mvc.AbstractController?.handleRequest(AbstractController?.java:153) at

org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter?.handle

(SimpleControllerHandlerAdapter?.java:48)

at

org.springframework.web.servlet.DispatcherServlet?.doDispatch(DispatcherServlet?.java:900)

at org.springframework.web.servlet.DispatcherServlet?.doService(DispatcherServlet?.java:827)

The following is from the console log, with full DEBUG enabled in logback.

ibisph-view DEBUG 15:58:51 o.i.q.m.AbstractQueryModuleModelMap?.addMissingQueryResultRecordElements - found record for dimension: [3, 0]. ibisph-view WARN 15:58:51 org.ibisph.util.XMLLib.getNodes - POTENTIAL ISSUE - child node supplied with root based xpath. Current node: org.dom4j.tree.DefaultElement?@6b1e1167 [Element: <CONFIGURATION attributes: []/>], xpath: /QUERY_MODULE/IBISQ_QUERY_RESULT/RECORDS/RECORD[DIMENSIONS[(DIMENSION[NAME='GeoCnty?' and VALUE/text()='4']) and (DIMENSION[NAME='Year00_' and VALUE/text()='2013'])]] ibisph-view DEBUG 15:58:51 o.s.w.s.m.a.AnnotationMethodHandlerExceptionResolverResolving? exception from handler [org.ibisph.web.springmvc.ModelMapListProcessingController?@2ec95198]: java.lang.NullPointerException? ibisph-view DEBUG 15:58:51 o.s.w.s.m.a.ResponseStatusExceptionResolverResolving? exception from handler [org.ibisph.web.springmvc.ModelMapListProcessingController?@2ec95198]: java.lang.NullPointerException? ibisph-view DEBUG 15:58:51 o.s.w.s.m.s.DefaultHandlerExceptionResolverResolving? exception from handler [org.ibisph.web.springmvc.ModelMapListProcessingController?@2ec95198]: java.lang.NullPointerException? ibisph-view DEBUG 15:58:51 o.s.w.s.DispatcherServletCould? not complete request java.lang.NullPointerException?: null

at

org.ibisph.querymodule.modelmap.AddMissingQueryResultRecordsToQueryModule?

.buildQueryResultRecordElements(AddMissingQueryResultRecordsToQueryModule?.java:233) ~[ibisph-

2.3.0.jar:na]

at

org.ibisph.querymodule.modelmap.AddMissingQueryResultRecordsToQueryModule?.processModelMap

(AddMissingQueryResultRecordsToQueryModule?.java:119) ~[ibisph-2.3.0.jar:na]

at

org.ibisph.web.springmvc.ModelMapListProcessingController?.getModelMap

(ModelMapListProcessingController?.java:123) ~[ibisph-2.3.0.jar:na]

at

org.ibisph.web.springmvc.ModelMapAndViewController?.handleRequestInternal

(ModelMapAndViewController?.java:98) ~[ibisph-2.3.0.jar:na]

at

org.springframework.web.servlet.mvc.AbstractController?.handleRequest

(AbstractController?.java:153) ~[org.springframework.web.servlet-3.1.0.RELEASE.jar:3.1.0.RELEASE]

at

org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter?.handle

(SimpleControllerHandlerAdapter?.java:48) ~[org.springframework.web.servlet-

3.1.0.RELEASE.jar:3.1.0.RELEASE]

at

org.springframework.web.servlet.DispatcherServlet?.doDispatch(DispatcherServlet?.java:900) ~

[org.springframework.web.servlet-3.1.0.RELEASE.jar:3.1.0.RELEASE]

at

org.springframework.web.servlet.DispatcherServlet?.doService(DispatcherServlet?.java:827) ~

[org.springframework.web.servlet-3.1.0.RELEASE.jar:3.1.0.RELEASE]

Other Observations: It appears that the XML generated by IBISQ is correct. If you select years 2012, 2011 and 2010, using the above query, the error will not be generated, and results will come back. Similarly trying other combinations of Display By Group By and other filters being applied do not cause the error to be generated. There have been other query modules that generate the same error.

Temporary solution is to comment out the <ADD_MISSING_QUERY_RESULT_RECORDS><ALL_FLAG/> </ADD_MISSING_QUERY_RESULT_RECORDS> in all query configurations

When the ibisq query application URL is run with SAS set to 2, 3, or 4, no obvious errors are found, and the data returned is what is expected.

Also tried adding a . row in the Year dimension file, but that didn't resolve the issue. (there is no . in the year dimension file now)

Change History (6)

comment:1 Changed 2 years ago by Paul Leo

Description: modified (diff)

comment:2 Changed 2 years ago by Paul Leo

Description: modified (diff)
Priority: -Low+Medium

comment:3 Changed 2 years ago by Paul Leo

Description: modified (diff)

comment:4 Changed 2 years ago by Paul Leo

Description: modified (diff)

comment:5 Changed 2 years ago by Lois Haggard

Description: modified (diff)
Milestone: UnassignedNeeds Analysis

This problem is unpredictable. It seems to happen often enough that it is not "rare." This could be a week of development time.

Hawaii has removed that xml element from their query module.xml files. It's not ideal. Paul will talk with Kathryn to see how important she thinks it is.

comment:6 Changed 2 years ago by Paul Leo

The issue may be with the W3C document that is created, and repopulated by the ADD_MISSING code

Note: See TracTickets for help on using tickets.