FHIR Chat · NPE Error running FHIR build · committers

Stream: committers

Topic: NPE Error running FHIR build


view this post on Zulip Jean Duteau (Nov 16 2020 at 19:47):

I'm trying to do a FHIR core build after being away for awhile. I keep getting a NullPointer when it is trying to produce schemas. To make sure it wasn't something I did, I just cloned a fresh repository and ran it and am getting the same error. I had Melva do a build on her machine and it got past this point:

     [java] Generate RDF                                                               0.458  50sec 1121MB
     [java] Produce Schemas                                                            2.605  53sec  592MB
     [java] This was a Full Build                                                      0.015  53sec  596MB
     [java] java.lang.NullPointerException
     [java]     at org.hl7.fhir.definitions.generators.xsd.XSDBaseGenerator.genIncludedCode(XSDBaseGenerator.java:560)
     [java]     at org.hl7.fhir.definitions.generators.xsd.XSDBaseGenerator.generateEnum(XSDBaseGenerator.java:533)
     [java]     at org.hl7.fhir.definitions.generators.xsd.XSDBaseGenerator.genType(XSDBaseGenerator.java:451)
     [java]     at org.hl7.fhir.definitions.generators.xsd.XSDBaseGenerator.generate(XSDBaseGenerator.java:128)
     [java]     at org.hl7.fhir.definitions.generators.xsd.SchemaGenerator.generate(SchemaGenerator.java:74)
     [java]     at org.hl7.fhir.tools.publisher.Publisher.produceSpecification(Publisher.java:2125)
     [java]     at org.hl7.fhir.tools.publisher.Publisher.execute(Publisher.java:628)
     [java]     at org.hl7.fhir.tools.publisher.Publisher.main(Publisher.java:488)
     [java] FHIR build failure @ Mon, Nov 16, 2020 12:46-0700                          1.328  54sec  596MB
     [java] Error: null

view this post on Zulip Jean Duteau (Nov 16 2020 at 19:50):

In the code at that spot, it's trying to output some code system:

    write("      <xs:enumeration value=\"" + Utilities.escapeXml(cc.getCode()) + "\">\r\n");
    write("        <xs:annotation>\r\n");
    write("          <xs:documentation xml:lang=\"en\">" + Utilities.escapeXml(cc.getDisplay()) + "</xs:documentation>\r\n"); // todo: do we need to look the definition up?
    CodeSystem cs = workerContext.fetchCodeSystem(cc.getSystem());
    if (cs != null && cc.hasCode()) {
      ConceptDefinitionComponent c = getCodeDefinition(cc.getCode(), cs.getConcept());
      for (ConceptDefinitionDesignationComponent l : c.getDesignation())
        if (l.hasLanguage())
          write("          <xs:documentation xml:lang=\""+l.getLanguage()+"\">"+Utilities.escapeXml(l.getValue())+"</xs:documentation>\r\n");
    }

view this post on Zulip Jean Duteau (Nov 16 2020 at 19:55):

adding some debug code and the error occurs when it's trying to write out http://unitsofmeasure.org#s

view this post on Zulip Jean Duteau (Nov 16 2020 at 20:04):

I added a null check around the for statement above as a workaround

view this post on Zulip Vassil Peytchev (Nov 16 2020 at 20:20):

Did you run clean before trying to build?

view this post on Zulip Jean Duteau (Nov 16 2020 at 20:23):

yep. and as I said, I also created a clean new repository clone

view this post on Zulip Grahame Grieve (Nov 16 2020 at 21:06):

http://unitsofmeasure.org#s ? or http://unitsofmeasure.org#vs

view this post on Zulip Jean Duteau (Nov 16 2020 at 21:07):

i spit out code system and code and that was spit out just before the NPE

view this post on Zulip Grahame Grieve (Nov 16 2020 at 21:23):

ah

view this post on Zulip Grahame Grieve (Nov 16 2020 at 22:25):

oh, this is a downstream consequence of UTG fake declarations...

view this post on Zulip Jean Duteau (Dec 21 2020 at 21:19):

I'm still getting this NPE when I try to build FHIR locally. I'm not sure why others aren't seeing this.

view this post on Zulip Jean Duteau (Dec 21 2020 at 21:26):

I had to add this line in XSDBaseGenerator to get around the NPE:

      ConceptDefinitionComponent c = getCodeDefinition(cc.getCode(), cs.getConcept());
      if (c != null)
      for (ConceptDefinitionDesignationComponent l : c.getDesignation())

(line 559-560)

view this post on Zulip Grahame Grieve (Dec 23 2020 at 01:13):

what code does this trigger for>?

view this post on Zulip Grahame Grieve (Dec 23 2020 at 01:13):

because there's an underlying problem if this happens

view this post on Zulip Jean Duteau (Dec 23 2020 at 18:06):

I'm assuming the same one as before (http://unitsofmeasure.org#s) but I'll put my debugging code back in to double-check


Last updated: Apr 12 2022 at 19:14 UTC