Hi,
Has anyone used successfully the JSON parser with the HAPI FHIR DSTU3 libraries?
I was able to parse with the HAPI FHIR v1.6 and DSTU2.
DSTU3 has different methods and on top it looks like there are some problems with the HAPI FHIR Libraries for DSTU3.
If I try the parseResource method with DSTU3, my Android project crashes at runtime..
It crashes with different errors depending on the version of the library (v1.6 or v2).
If I use HAPI FHIR v2 then I get an error that XMLResolver class couldn't be found,
Here is a picture with a partial structure of the v1.6 DSTU2 library which was parsing successfully.
If you look at the same structure of the v2.0 DSTU3 library, you will see that the repackage.javax is missing.

However it looks like there is still a reference to the XMLResolver class so the error message is:
java.lang.NoClassDefFoundError: Failed resolution of: Lca/uhn/fhir/repackage/javax/xml/stream/XMLResolver;
The v1.6 DSTU3 crashes with a different error (which may apply to the v2 library too).
If you look at the structure of the v1.6 DSTU3, it contains a class called Base64BinaryType:
The Base64BinaryType imports commons codec and the commons-codec-1.10.jar is included with the HAPI FHIR for Android download.
However it turns out that Android has internal older commons codec library which makes the use of later versions of commons codec highly problematic on Android.
Here is an article on the topic:
Commons Codec on Android
So the parser with HAPI FHIR v1.6 DSTU3 library crashes with the error:
java.lang.NoSuchMethodError: No static method decodeBase64(Ljava/lang/String;)[B in class Lorg/apache/commons/codec/binary/Base64; or its super classes (declaration of 'org.apache.commons.codec.binary.Base64' appears in /system/framework/org.apache.http.legacy.boot.jar)
Please, let me know your thoughts on this.
Thank you
Antoaneta