obsidiansystems / ex-healthcare-claims-processing

Reference DAML application demonstrating a healthcare use case.
Apache License 2.0
0 stars 1 forks source link

Fix java compile error #69

Closed richardkapolnai-da closed 3 years ago

richardkapolnai-da commented 3 years ago

To fix https://github.com/obsidiansystems/ex-healthcare-claims-processing/issues/65

Licenses still need to be added, so to pass mvn verify, please combine the following:

Please see https://github.com/digital-asset/ex-cbdc/blob/main/pom.xml

runeksvendsen commented 3 years ago

Thank you Richard. Unfortunately I don't know how to make Circle CI build pull requests from forks. So, for now, I have cherry-picked your commit (with the Java fix) https://github.com/obsidiansystems/ex-healthcare-claims-processing/pull/69/commits/218acc95280f267cde0cb6e2438bedcac1dfeb21 into this local branch: https://github.com/obsidiansystems/ex-healthcare-claims-processing/tree/fix-java-compile-error

For this branch/commit Circle CI reports the following error:

-------------------------------------------------------------------------------
Test set: com.daml.product.healthcareclaims.HealthcareClaimsProcessingIT
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.104 s <<< FAILURE! - in com.daml.product.healthcareclaims.HealthcareClaimsProcessingIT
com.daml.product.healthcareclaims.HealthcareClaimsProcessingIT  Time elapsed: 0.103 s  <<< ERROR!
java.lang.ExceptionInInitializerError
    at com.daml.product.healthcareclaims.HealthcareClaimsProcessingIT.<clinit>(HealthcareClaimsProcessingIT.java:57)

Which is here: https://github.com/obsidiansystems/ex-healthcare-claims-processing/blob/0ff5d30bd3760c45b457c2f82351367114308685/src/test/java/com/daml/product/healthcareclaims/HealthcareClaimsProcessingIT.java#L57

Do you know why this error happens?

richardkapolnai-da commented 3 years ago

Thank you Richard. Unfortunately I don't know how to make Circle CI build pull requests from forks. So, for now, I have cherry-picked your commit (with the Java fix) 218acc9 into this local branch: https://github.com/obsidiansystems/ex-healthcare-claims-processing/tree/fix-java-compile-error

For this branch/commit Circle CI reports the following error:

-------------------------------------------------------------------------------
Test set: com.daml.product.healthcareclaims.HealthcareClaimsProcessingIT
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.104 s <<< FAILURE! - in com.daml.product.healthcareclaims.HealthcareClaimsProcessingIT
com.daml.product.healthcareclaims.HealthcareClaimsProcessingIT  Time elapsed: 0.103 s  <<< ERROR!
java.lang.ExceptionInInitializerError
  at com.daml.product.healthcareclaims.HealthcareClaimsProcessingIT.<clinit>(HealthcareClaimsProcessingIT.java:57)

Which is here:

https://github.com/obsidiansystems/ex-healthcare-claims-processing/blob/0ff5d30bd3760c45b457c2f82351367114308685/src/test/java/com/daml/product/healthcareclaims/HealthcareClaimsProcessingIT.java#L57

Do you know why this error happens?

Hi Rune, yes, I don't know how to configure CI for cross-repo either. (Just a note: you can still merge this with admin rights I guess. Or if it's easier for you, you can give me write access to your repo.) You should also cherry-pick my other commit 542faad, which is critical for mvn verify. Otherwise it fails locally on my machine during daml-codegen.

runeksvendsen commented 3 years ago

Richard, the reason mvn verify fails for you is because we've moved the root daml.yaml file and daml folder into the model folder. The solution is to run mvn verify inside the model folder and pass it the argument -f ../pom.xml. We do that already in our CI script: https://github.com/obsidiansystems/ex-healthcare-claims-processing/blob/3a1b4485ead4237243f0a7aac44f97d79a32160a/.circleci/config.yml#L133-L134

richardkapolnai-da commented 3 years ago

I know you moved it, this is exactly why I suggest to cherry-pick 542faad. Probably mvn is confused because it's executed from a different directory. However, luckily, we do not need to figure this out. Cherry-picking 542faad enables running mvn verify from the project root directory, and makes the test pass (except the license check as I wrote on the top).

Can you please try it locally? Checkout my branch (fix-java-compile-error) in my fork, run

make build
mvn verify
runeksvendsen commented 3 years ago

Thank you Richard. I didn't catch that you thought running maven inside model was the cause of the above issue.

I will pull your changes related to getting HealthcareClaimsProcessingIT.java to compile via https://github.com/obsidiansystems/ex-healthcare-claims-processing/pull/73, and address the license-related issues in a separate PR.