diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_7_0/3198-package-loading-woes.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_7_0/3198-package-loading-woes.yaml new file mode 100644 index 00000000000..800e393f9fc --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_7_0/3198-package-loading-woes.yaml @@ -0,0 +1,5 @@ +--- +type: change +issue: 3198 +jira: SMILE-3452 +title: "Fixed a regression where packages would fail to load if HAPI-FHIR was operating in DATABASE binary storage mode." diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/JpaPackageCache.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/JpaPackageCache.java index 59790c4197c..0676f12fb24 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/JpaPackageCache.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/JpaPackageCache.java @@ -28,6 +28,7 @@ import ca.uhn.fhir.jpa.api.dao.DaoRegistry; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.api.model.ExpungeOptions; import ca.uhn.fhir.jpa.binstore.IBinaryStorageSvc; +import ca.uhn.fhir.jpa.binstore.NullBinaryStorageSvcImpl; import ca.uhn.fhir.jpa.dao.data.INpmPackageDao; import ca.uhn.fhir.jpa.dao.data.INpmPackageVersionDao; import ca.uhn.fhir.jpa.dao.data.INpmPackageVersionResourceDao; @@ -198,7 +199,7 @@ public class JpaPackageCache extends BasePackageCacheManager implements IHapiPac * @throws IOException */ private byte[] fetchBlobFromBinary(IBaseBinary theBinary) throws IOException { - if (myBinaryStorageSvc != null) { + if (myBinaryStorageSvc != null && !(myBinaryStorageSvc instanceof NullBinaryStorageSvcImpl)) { return myBinaryStorageSvc.fetchDataBlobFromBinary(theBinary); } else { byte[] value = BinaryUtil.getOrCreateData(myCtx, theBinary).getValue();