FHIR Chat · index out of bounds exception with transaction bundle POST · hapi

Stream: hapi

Topic: index out of bounds exception with transaction bundle POST


view this post on Zulip Rob Hausam (May 18 2021 at 16:50):

Does anyone know what might the cause for this error when I'm POSTing a transaction Bundle to the base server url?:

{
    "resourceType": "OperationOutcome",
    "text": {
        "status": "generated",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>Failed to call access method: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0</pre></td>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
    },
    "issue": [
        {
            "severity": "error",
            "code": "processing",
            "diagnostics": "Failed to call access method: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0"
        }
    ]
}

The error message itself isn't super helpful in figuring it out. And I'm not immediately seeing anything obviously wrong with the Bundle or what I'm trying to do. POSTing transaction bundles worked on my server before, but it's been quite a while since I've tested that (it's now at 5.4.0-PRE2-SNAPSHOT).

view this post on Zulip Grahame Grieve (May 18 2021 at 16:52):

which server

view this post on Zulip Rob Hausam (May 18 2021 at 16:52):

https://fhir.hausamconsulting.com/r4

view this post on Zulip Grahame Grieve (May 18 2021 at 16:52):

oh we're in the hapi stream. duh!

view this post on Zulip Rob Hausam (May 18 2021 at 16:53):

yep!

view this post on Zulip Rob Hausam (May 18 2021 at 22:28):

It looks like I now have the source of this error. HAPI doesn't seem to be properly handling a CodeableConcept data type with 'text'only (no Codings). I am not able to PUT (or POST) an Observation resource (and very likely any other resource, although I haven't tested that) with a CodeableConcept instance like:

    "code": {
        "text": "Blood typing"
    },

That results in the Failed to call access method: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 error, even though it's perfectly valid in the base FHIR spec and the IPS IG and it validates with Java validator just fine. If I add a 'coding' to the datatype then the resource is created without a problem.Here's the related discussion in the IPS stream.
@James Agnew?

view this post on Zulip Rob Hausam (May 20 2021 at 14:48):

Has anyone else seen this? Or have you been able to successfully create an instance on the server with a CodeableConcept containing only text?


Last updated: Apr 12 2022 at 19:14 UTC