Closed CJStadler closed 2 years ago
Hi @CJStadler . We'll look into it.
Hi @CJStadler . I regret I cannot reproduce the problem in my environment, which is running level 1.0.16.
I'm trying to figure out how I can reproduce the problem.
It surprises me that NULL from getAdditionalResourcesLocation() is causing a problem, because there are checks which only use the value if it is not null.
Your idea of adding additional.resources.location
to the config.properties
file is a good one. I assume you have downloaded source code? Can you change the existing config.properties
located at src/main/resources/config.properties
?
There is also a way to specify the config file from the command line. It is documented in the README.md.
Thanks so much for investigating @cragun47! Unfortunate that you can't reproduce ☹️
I will try to change the config.properties
and test.
Here is my reading of the code, but maybe there is a null
check I am missing. If the config field isn't present I believe it will default to null
here: https://github.com/LinuxForHealth/hl7v2-fhir-converter/blob/11ef1aca2c1f5c0f4cb4adb737f164b2e3158c42/src/main/java/io/github/linuxforhealth/core/config/ConverterConfiguration.java#L93
That null
would then be passed to Paths.get
here, where the exception is raised: https://github.com/LinuxForHealth/hl7v2-fhir-converter/blob/11ef1aca2c1f5c0f4cb4adb737f164b2e3158c42/src/main/java/io/github/linuxforhealth/hl7/resource/ResourceReader.java#L84
Note that this is before the null
check here: https://github.com/LinuxForHealth/hl7v2-fhir-converter/blob/11ef1aca2c1f5c0f4cb4adb737f164b2e3158c42/src/main/java/io/github/linuxforhealth/hl7/resource/ResourceReader.java#L91
Yet when I do my unit tests and run the converter with that config parameter missing, there is no exception.
I’d like to reproduce it before I make changes, so I can prove the fix works.
On Wed, Feb 2, 2022 at 10:12 AM Chris Stadler @.***> wrote:
If the config field isn't present I believe it will default to null here: https://github.com/LinuxForHealth/hl7v2-fhir-converter/blob/11ef1aca2c1f5c0f4cb4adb737f164b2e3158c42/src/main/java/io/github/linuxforhealth/core/config/ConverterConfiguration.java#L93 That null would then be passed to Paths.get here, where the exception is raised: https://github.com/LinuxForHealth/hl7v2-fhir-converter/blob/11ef1aca2c1f5c0f4cb4adb737f164b2e3158c42/src/main/java/io/github/linuxforhealth/hl7/resource/ResourceReader.java#L84 Note that this is before the null check here: https://github.com/LinuxForHealth/hl7v2-fhir-converter/blob/11ef1aca2c1f5c0f4cb4adb737f164b2e3158c42/src/main/java/io/github/linuxforhealth/hl7/resource/ResourceReader.java#L91
— Reply to this email directly, view it on GitHub https://github.com/LinuxForHealth/hl7v2-fhir-converter/issues/427#issuecomment-1028162216, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFP5IPOAVYPX73CJJ7C5PLUZFQXXANCNFSM5NJU6RIA . You are receiving this because you commented.Message ID: @.***>
-- Brian Cragun LinkedIn http://www.linkedin.com/in/briancragun
Hi @cragun47, I've figured out the NPE is thrown when I run my application with openjdk 17, but not when I use openjdk 11. It looks like not throwing an NPE in this case was a bug in openjdk <16: https://bugs.openjdk.java.net/browse/JDK-8254876.
For my immediate purposes I can just use openjdk 11, but it still seems like there is something worth fixing here. Happy to open a PR if that makes sense to you.
As a side note, ./gradlew build
fails for me with openjdk 17:
$ JAVA_HOME=/usr/local/opt/openjdk@17 ./gradlew build
> Configure project :
localDevEnv is true - Setting sourceset to the src directory
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x436941f7) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x436941f7
@CJStadler If you'd like to open a PR, that would be great.
Describe the bug Running
FHIRConverterRunFile
on versions1.0.14
and greater I get the following errorIt looks to me like
converterConfig.getAdditionalResourcesLocation()
is returningnull
, which is then passed toPaths.get
. I suspect the issue may be as simple as https://github.com/LinuxForHealth/hl7v2-fhir-converter/blob/58ad7c9/src/main/resources/config.properties missing theadditional.resources.location
key, but I haven't been able to get it to read a modified config file to confirm this.It runs successfully on version
1.0.13
.To Reproduce I'm not sure how to run
FHIRConverterRunFile
directly from this repository (not very familiar with java) — I did it by setting up a minimal application with maven, withhl7v2-fhir-converter
as a dependency.Desktop (please complete the following information):
Thank you!