Search code examples
javaapache-sparkhl7-fhirhapi-fhir

Getting Error : Failed to load org/hl7/fhir/instance/model/api/IAnyResource on running spark-submit


I am trying to execute spark-submit in a java which also has some HAPI-FHIR libraried needed in the project. When I execute the job I get the following error

Error: Failed to load package.MainClass: org/hl7/fhir/instance/model/api/IAnyResource

I have already included the FHIR dependencies in pom.xml as shown FHIR dependencies

FHIR release : R4
HAPI FHIR version is : 5.4.2
PS : I am running it on an ec2 instance


Solution

  • As @crig mentioned Spark could not find the jars in its class path. I tried creating a fat jar for all the jars but don't lnow why the fat jar could not be created However adding the jars to spark-submit --jars hapi-fhir-base-5.4.2 solved the problem