Stream: hapi
Topic: Search results in NullPointerException
Ann Merete Duedal Jensen (Apr 13 2021 at 12:59):
Hi,
My team and I are using HAPI FHIR 5.1.0 with R4.
For Encounters where one or more QuestionnaireResponses refer to the Encounter, we get a NullPointerException while doing this search:
http://host:port/fhir/Encounter?_id=XXX&_revinclude=*&_include=*
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "processing",
"diagnostics": "Failed to call access method: java.lang.NullPointerException"
}
]
}
I can reproduce the error on my local jetty server and here's a very small snippet from the log:
Caused by: java.lang.NullPointerException
at ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId.hashCode(ResourcePersistentId.java:55)
I believe I know why we get the NullPointerException.
Our QuestionnaireResponses doesn't contain a literal reference to a Questionnaire, but a reference by a canonical url as per definition.
When looking in the database the TARGET_RESOURCE_ID (Persistent ID) is NULL in these cases and instead TARGET_RESOURCE_URL is populated in schema HFJ_RES_LINK.
My questions:
Are any of you familiar with this error?
Does anyone of you know if this error also exists in HAPI FHIR 5.3.0? (I can't find anything in the HAPI FHIR changelog)
FYI: I have tried to reproduce the error on the server hapi.fhir.org, but I receive a valid response when creating the ressources and doing the search here.
Jens Villadsen (Apr 13 2021 at 13:09):
I would recommend to update latest stable - being 5.3.0 for now
Ann Merete Duedal Jensen (Apr 19 2021 at 09:39):
That what also my thought. Just wanted to check if someone knew if the problem still exists in 5.3.0.
Signe Hejgaard Kristoffersen (Apr 21 2021 at 10:59):
@James Agnew Do you know if this issue has been fixed in 5.3.0? We cannot deduce it from the changelog
John Silva (Apr 21 2021 at 11:10):
@Signe Hejgaard Kristoffersen @James Agnew - Not sure if this is related but in HAPI 5.0.2 (used by cqf-ruler) we were seeing NullPointerExceptions when performing .../ValueSet/<valueSetId>/$expand operations. This seemed to happen after the CodeSystem associated with the ValueSet was expanded. We recently switched to HAPI 5.3.0 and this problem went away. (As I understand it, indices for CodeSystem expansions were stored on the file system in pre-5.3.0 HAPI but with 5.3.0 they are now stored in the database; maybe James could clarify or point us to the release notes that indicates this change.)
Last updated: Apr 12 2022 at 19:14 UTC