We have code looking like this.
HeaderCDSForPRForGuidedBuying requisitionHeader = readHeaderInternal(draftUUID);
try {
requisitionHeaderAddress = requisitionHeader.getGuidedProcmtReqnDelivAddrOrFetch();
} catch (NullPointerException ex) {
logger.error("Exception occurred: No Address is associated with the requisition header", ex);
}
As can be seen, we are first fetching one entity(header), and then associated entity(DeliveryAddress), while this code works normally within the app, or within eclipse, it breaks when run as part of a maven execution. We have integration tests which are run with maven so it fails for us. The error is this.
java.lang.VerifyError: Stack map does not match the one at exception handler 275 Exception Details: Location: com/sap/cloud/sdk/odatav2/connectivity/internal/ODataExceptionInternalResultHandler.createError(Ljava/lang/String;Ljava/lang/Object;I)Lcom/sap/cloud/sdk/odatav2/connectivity/internal/ODataExceptionInternal; @275: astore Reason: Type 'org/json/JSONException' (current frame, stack[0]) is not assignable to 'java/lang/RuntimeException' (stack map, stack[0]) Current Frame: bci: @42 flags: { } locals: { 'com/sap/cloud/sdk/odatav2/connectivity/internal/ODataExceptionInternalResultHandler', 'java/lang/String', 'java/lang/Object', integer, integer, 'com/sap/cloud/sdk/odatav2/connectivity/internal/ODataExceptionInternal', 'java/lang/String', 'org/apache/http/HttpResponse', 'java/lang/String', '[Lorg/apache/http/Header;' } stack: { 'org/json/JSONException' } Stackmap Frame: bci: @275 flags: { } locals: { 'com/sap/cloud/sdk/odatav2/connectivity/internal/ODataExceptionInternalResultHandler', 'java/lang/String', 'java/lang/Object', integer, integer, 'com/sap/cloud/sdk/odatav2/connectivity/internal/ODataExceptionInternal', 'java/lang/String', 'org/apache/http/HttpResponse', 'java/lang/String', '[Lorg/apache/http/Header;' } stack: { 'java/lang/RuntimeException' }
This same issue is reported at https://github.com/Wikidata/Wikidata-Toolkit/issues/58. I believe a fix is also mentioned in that link.
Please fix it so that we can run our maven tests without any errors.
Thanks, Sachin