Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using mvn install #151

Open
morales-felix opened this issue Nov 11, 2021 · 5 comments
Open

Error when using mvn install #151

morales-felix opened this issue Nov 11, 2021 · 5 comments

Comments

@morales-felix
Copy link

morales-felix commented Nov 11, 2021

This is Felix, from Northwestern.

In trying to deploy the library on my Windows 10 machine, I encountered this error:

Test set: org.monarchinitiative.loinc2hpocore.io.LoincTableCoreParserTest

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.114 s <<< FAILURE! - in org.monarchinitiative.loinc2hpocore.io.LoincTableCoreParserTest
org.monarchinitiative.loinc2hpocore.io.LoincTableCoreParserTest.testParser Time elapsed: 0.072 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <28> but was: <0>
at org.monarchinitiative.loinc2hpocore.io.LoincTableCoreParserTest.testParser(LoincTableCoreParserTest.java:33)

When looking at LoincTableCoreParserTest, it seems to read a file. Could it be that such file is empty when I clone the repository?

@pnrobinson
Copy link
Member

The test starts with this

 URL url = LoincTableCoreParserTest.class.getClassLoader().getResource("LoincTableCoreTiny.csv");
        if (url==null) {
            throw new Loinc2HpoRuntimeException("Could not get path to \"LoincTableCoreTiny.csv\"");
        }
        LoincTableCoreTinyPath = url.getPath();

It reads a file src/test/resources/LoincTableCoreTiny.csv and if it does not find the file it throws a different exception. Can you see the file on your computer?

@morales-felix
Copy link
Author

morales-felix commented Nov 12, 2021

Just checked that path, and I do have that file. It has 28 lines. The error I get when installing suggests that the file is being read, but for some reason it counts 0 lines present in the file.

@pnrobinson
Copy link
Member

Are you using IntelliJ? Any chance you could run this in a debugger? It is working on my side...

@morales-felix
Copy link
Author

Will get back to you this week about that.

@morales-felix
Copy link
Author

morales-felix commented Nov 22, 2021

Solved the problem, there was an issue with the path to the directory onto which I cloned this repository. Specifically, my path had the following feature: "...\Northwestern's files...", and the issue was solved by switching to "...\Northwestern_files...". It's working now.

It took me a bit to figure out what was going on in part because of my unfamiliarity with Java and Maven. But I also noticed that once the LoincParser was unable to open the path to the file, code continued executing and printing. Would suggest crashing or stopping execution of the code when reaching line 55 at LoincTableCoreParser.java (the exception catcher).

Edit: I realize the above code could be expected to catch a path error, but in my case, it is likely that the code did find a string representing the path, but could not infer the actual path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants