FHIR Chat · FHIR validator ClassNotFoundException · implementers

Stream: implementers

Topic: FHIR validator ClassNotFoundException


view this post on Zulip Abigail Huang (May 21 2021 at 00:21):

Dear all,
I'm trying to validate some resource instances against DSTU2 (FHIR 1.0.2) and tried running the newest FHIR validator "validator_cli.jar" from this site (https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator) on openJDK 16.0.1 (https://jdk.java.net/16/).

However, I keep getting this error when running the file:
Error: Could not find or load main class org.hl7.fhir.validation.ValidatorCli
Caused by: java.lang.ClassNotFoundException: org.hl7.fhir.validation.ValidatorCli

I'm new to using Java validators and would greatly appreciate any help! (Alternatively, are there any recommended DSTU2 validators I can use online?)

Thanks so much!

view this post on Zulip Lloyd McKenzie (May 21 2021 at 02:17):

@Mark Iantorno

view this post on Zulip Matt Jenks (May 21 2021 at 13:27):

@Abigail Huang I am running into the same problem on both linux and MAC Big Sur. The command 'java -jar validator_cli.jar ...' seems to work find on windows for us, but not the other two. If I expand the jar and run something like 'java org.hl7.fhir.validation.ValidatorCli' from the top level of the expansion, it seems to work fine on Big Sur. I also see the same error using the openjdk:16 docker image.

view this post on Zulip Lloyd McKenzie (May 21 2021 at 13:33):

@Mark Iantorno

view this post on Zulip Mark Iantorno (May 21 2021 at 13:45):

Hey, I will take a look now

view this post on Zulip Mark Iantorno (May 21 2021 at 13:46):

for now you can use fhirvalidator.org

view this post on Zulip Mark Iantorno (May 21 2021 at 13:46):

while I look

view this post on Zulip Mark Iantorno (May 21 2021 at 13:47):

hrm, I can confirm it is very broken

view this post on Zulip Mark Iantorno (May 21 2021 at 13:47):

I'll look into it now. Probably something to do with the latest HAPI release.

view this post on Zulip Mark Iantorno (May 21 2021 at 15:40):

@Matt Jenks can you confirm this work on windows?

view this post on Zulip Mark Iantorno (May 21 2021 at 15:56):

Alright I've determined the issue and put in a fix

view this post on Zulip Mark Iantorno (May 21 2021 at 15:57):

but please answer my question above. It's not that I don't believe you that it runs on Windows. I just...don't...believe you.

view this post on Zulip Mark Iantorno (May 21 2021 at 15:57):

If it does, I would want to investigate further on that.

view this post on Zulip Matt Jenks (May 21 2021 at 16:00):

@Mark Iantorno Yeah fair enough. My team member @Corey Wen was the one that was running it on windows. I did not. We pulled it from this page, https://www.hl7.org/fhir/downloads.html, using this link, https://github.com/hapifhir/org.hl7.fhir.core/releases/latest/download/validator_cli.jar.

view this post on Zulip Matt Jenks (May 21 2021 at 16:01):

@Corey Wen Can you verify where and when you pulled the validator jar that was working for you on windows?

view this post on Zulip Mark Iantorno (May 21 2021 at 16:02):

Verify the version as well please.

view this post on Zulip Mark Iantorno (May 21 2021 at 16:02):

It will print when you run it.

view this post on Zulip Abigail Huang (May 21 2021 at 16:20):

thanks everyone for the help! greatly appreciated!

view this post on Zulip Corey Wen (May 21 2021 at 16:49):

Matt Jenks said:

Corey Wen Can you verify where and when you pulled the validator jar that was working for you on windows?

I downloaded the validator ~1 week ago from "https://github.com/hapifhir/org.hl7.fhir.core/releases/latest/download/validator_cli.jar", which was found at "https://www.hl7.org/fhir/downloads.html"
I believe the version is "FHIR Validation tool Version 5.3.11 (Git# 33fffe28ff6b). Built 2021-04-22T05:48:36.375Z (29 days old)"

view this post on Zulip Mark Iantorno (May 21 2021 at 17:23):

yeah, so that's not the latest that was crashing

view this post on Zulip Mark Iantorno (May 21 2021 at 17:23):

I suspect the latest will crash on all platforms

view this post on Zulip Mark Iantorno (May 21 2021 at 17:24):

There should be no reason one OS would work while the others did not

view this post on Zulip Mark Iantorno (May 21 2021 at 17:24):

The release is going right now to build the new validator

view this post on Zulip Abigail Huang (May 21 2021 at 19:11):

Just to close the loop, I tried the validator on both Mac OS and Windows and they both give the same ClassNotFoundException error. Thanks all!

view this post on Zulip Matt Jenks (May 21 2021 at 19:45):

@Abigail Huang I just pulled the updated version that @Mark Iantorno built about 2 hours ago. It is working for me in openjdk 16 docker image and locally on my mac. I pulled it from here https://github.com/hapifhir/org.hl7.fhir.core/releases/latest/download/validator_cli.jar".

view this post on Zulip Abigail Huang (May 21 2021 at 20:17):

Amazing and A HUGE THANK YOU!! It works for me now and I was able to validate my DSTU2 files without a problem.
This is a big help and most sincerely appreciated =)

(As a random FYI and now a moot point, I wasn't able to get fhirvalidator.org to work for v1.0.2. I selected v1.0.2 under Options but it keeps giving error messages when I hit validate that are consistent with R4 such as the fact that there is an
Unrecognised property '@model' or '@udi' although they exist in DSTU2 - but not R4.)

view this post on Zulip Mark Iantorno (May 21 2021 at 22:48):

okay, thanks for the feedback on that

view this post on Zulip Mark Iantorno (May 21 2021 at 22:48):

I will fix that on the website


Last updated: Apr 12 2022 at 19:14 UTC