HAPI-FHIR Starter Project - Seeing errors related to retrieval of conformance statement

1,474 views
Skip to first unread message

Joao Vicente

unread,
Feb 21, 2019, 4:55:03 AM2/21/19
to HAPI FHIR
Hi

I am trying to get https://github.com/hapifhir/hapi-fhir-jpaserver-starter running locally on my Ubuntu machine using Java 11.

Having followed the instructions in the README I executed

mvn jetty:run

Firstly, in the logs I see a lot of warnings, as per extract below
...
[WARNING] org.hl7.fhir.r4.utils.formats.XmlLocationAnnotator$LocationDataHandler scanned from multiple locations: [jar:file:///home/joao/.m2/repository/ca/uhn/hapi/fhir/hapi-fhir-structures-r4/3.7.0/hapi-fhir-structures-r4-3.7.0.jar!/org/hl7/fhir/r4/utils/formats/XmlLocationAnnotator$LocationDataHandler.class, jar:file:///home/joao/src/hapi-fhir-jpaserver-starter/target/jetty_overlays/hapi-fhir-testpage-overlay-3_7_0_war/WEB-INF/lib/hapi-fhir-structures-r4-3.7.0.jar!/org/hl7/fhir/r4/utils/formats/XmlLocationAnnotator$LocationDataHandler.class]
[WARNING] org.hl7.fhir.r4.utils.format I suspect that may be the issues.XmlLocationAnnotator scanned from multiple locations: [jar:file:///home/joao/.m2/repository/ca/uhn/hapi/fhir/hapi-fhir-structures-r4/3.7.0/hapi-fhir-structures-r4-3.7.0.jar!/org/hl7/fhir/r4/utils/formats/XmlLocationAnnotator.class, jar:file:///home/joao/src/hapi-fhir-jpaserver-starter/target/jetty_overlays/hapi-fhir-testpage-overlay-3_7_0_war/WEB-INF/lib/hapi-fhir-structures-r4-3.7.0.jar!/org/hl7/fhir/r4/utils/formats/XmlLocationAnnotator.class]
[WARNING] org.hl7.fhir.r4.utils.formats.XmlLocationData scanned from multiple locations: [jar:file:///home/joao/.m2/repository/ca/uhn/hapi/fhir/hapi-fhir-structures-r4/3.7.0/hapi-fhir-structures-r4-3.7.0.jar!/org/hl7/fhir/r4/utils/formats/XmlLocationData.class, jar:file:///home/joao/src/hapi-fhir-jpaserver-starter/target/jetty_overlays/hapi-fhir-testpage-overlay-3_7_0_war/WEB-INF/lib/hapi-fhir-structures-r4-3.7.0.jar!/org/hl7/fhir/r4/utils/formats/XmlLocationData.class]
...

After the application is running, when I load http://localhost:8080/hapi-fhir-jpaserver/ in my browser I see a red warning panel with the following message:

Warning!
Failed to load conformance statement, error was: ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException: Failed to parse response from server when performing GET to URL http://localhost/fhir/metadata - org.apache.http.conn.HttpHostConnectException: Connect to localhost:80 [localhost/127.0.0.1] failed: Connection refused (Connection refused)

In the logs I see the following entry:

2019-02-21 09:32:32.845 [qtp1260390769-18] WARN  ca.uhn.fhir.to.BaseController [BaseController.java:379] Failed to load conformance statement, error was: ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException: Failed to parse response from server when performing GET to URL http://localhost/fhir/metadata - org.apache.http.conn.HttpHostConnectException: Connect to localhost:80 [localhost/127.0.0.1] failed: Connection refused (Connection refused)

I suspect that given jetty is running on port 8080 by default, I may need to do some re-configuration, but it would be great if it did work out of the box.

At this point I would like to simply get the hapi-fhir stack running to the same level as the http://hapi.fhir.org/ and just being able to create a patient as I can do in the online server as follows


curl -X POST \
  -H 'content-type: application/json' \
  -d '{
  "resourceType": "Patient",
  "name": [
    {
      "family": "Vicente",
      "given": [
        "Joao"
      ]
    }
  ]
}'

It would also be great to, in the readme have instructions on how to smoke test the running server from command line (i.e. curl command to see the conformance statement and how to create a Patient) 

Thanks,
Joao

James Agnew

unread,
Feb 21, 2019, 8:37:43 AM2/21/19
to Joao Vicente, HAPI FHIR

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/93381457-e455-4fe5-baed-b4bea5a46e8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joao Vicente

unread,
Feb 21, 2019, 4:11:00 PM2/21/19
to HAPI FHIR
Thanks for your help James
After I uncommented the lines with "for Jetty use this:" in hapi.properties it is all working as expected.

I have created a pull request highlighting the need to change config to use Jetty, in case that helps someone else making the same mistake as me.

Cheers,
Joao 

Shweta Rajput

unread,
Jul 19, 2020, 1:34:34 AM7/19/20
to HAPI FHIR
I am facing the same problem with conformance  statement.
But I am unable to find "for Jetty use this:" in hapi.properties .
Can you please help me with this ?
That what I need to change in hapi.properties?

aite...@gmail.com

unread,
Jul 19, 2020, 5:04:07 PM7/19/20
to HAPI FHIR
I am facing the same problem, even after leaving the same configuration as it is in the starter project, i still got this error:
Warning!

Failed to load conformance statement, error was: ca.uhn.fhir.rest.server.exceptions.AuthenticationException: HTTP 401

It would be awesome if someone can point us to where the problem is. Its unfortunate that the same problem keep coming up.

Thanks
Aiten

James Agnew

unread,
Jul 19, 2020, 7:19:48 PM7/19/20
to aite...@gmail.com, HAPI FHIR
The server does not have any authentication by default. Have you added some?

If not, I recommend trying the server completely unmodified in a plain web container with no configuration. That scenario is well tested and known to work. Then introduce your changes one by one to figure out which one causes this.

aite...@gmail.com

unread,
Jul 19, 2020, 7:57:38 PM7/19/20
to HAPI FHIR
Hi James,
Thanks for your message. I indeed added a basic authentication to the Tomcat Web Server configuration. If that is causing the problem, where can I look into in the Hapi Code?

James Agnew

unread,
Jul 19, 2020, 9:03:06 PM7/19/20
to aite...@gmail.com, HAPI FHIR
You will need to supply authentication to it.


Cheers,
James

Reply all
Reply to author
Forward
0 new messages