You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CLI tabulation fails when using a config.json file referenced by its relation to the home directory. By contrast, the CLI tabulation successfully completes when the same config.json is referenced by absolute path or path relative to the working directory.
Example of Problem
For example, when this command in the zsh shell on MacOS (Apple Silicon):
./gradlew run --args="--cli ~/config.json
This error occurs:
2024-11-22 14:31:53 EST SEVERE: Error opening file: ~/config.json
java.io.FileNotFoundException: ~/config.json (No such file or directory)
Check file path and permissions and make sure they are correct!
2024-11-22 14:31:53 EST SEVERE: Failed to load contest config: ~/config.json
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:116)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1081)
Caused by: java.lang.NullPointerException: Cannot invoke "network.brightspots.rcv.ContestConfig.getRawConfig()" because "config" is null
at [email protected]/network.brightspots.rcv.TabulatorSession.checkConfigVersionMatchesApp(TabulatorSession.java:61)
at [email protected]/network.brightspots.rcv.TabulatorSession.tabulate(TabulatorSession.java:171)
at [email protected]/network.brightspots.rcv.TabulatorSession.tabulate(TabulatorSession.java:277)
at [email protected]/network.brightspots.rcv.Main.main(Main.java:86)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
... 6 more
Exception running application network.brightspots.rcv.Main
> Task :run FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Process 'command '/Users/malachi-at-rcvrc/Library/Java/JVMs/temurin-jdk-20.0.1+9/Contents/Home/bin/java'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 10s
5 actionable tasks: 2 executed, 3 up-to-date
By contrast, both of the following commands referencing the same config.json file both result in successful tabulation:
Referencing the config.json file by absolute path:
./gradlew run --args="--cli /Users/malachi-at-rcvrc/config.json"
Referencing the config.json file by relative path to working directory (when working directory is /Users/malachi-at-rcvrc/rctab/pre-2.0-develop/rcv):
./gradlew run --args="--cli ../../../config.json"
Reference Files Used In Example of Problem
config.json (located at /Users/malachi-at-rcvrc/config.json)
cvr.xlsx (located at /Users/malachi-at-rcvrc/cvr.xlsx)
Suggested Solution
Update the README to advise user to use the absolute path when referring to the config.json file in the command to run the CLI.
Update the CLI to support relative file paths that refer to the config.json file in relation to the $HOME directory.
The text was updated successfully, but these errors were encountered:
Problem Observed
The CLI tabulation fails when using a
config.json
file referenced by its relation to the home directory. By contrast, the CLI tabulation successfully completes when the sameconfig.json
is referenced by absolute path or path relative to the working directory.Example of Problem
For example, when this command in the zsh shell on MacOS (Apple Silicon):
./gradlew run --args="--cli ~/config.json
This error occurs:
By contrast, both of the following commands referencing the same
config.json
file both result in successful tabulation:Referencing the
config.json
file by absolute path:./gradlew run --args="--cli /Users/malachi-at-rcvrc/config.json"
Referencing the
config.json
file by relative path to working directory (when working directory is/Users/malachi-at-rcvrc/rctab/pre-2.0-develop/rcv
):./gradlew run --args="--cli ../../../config.json"
Reference Files Used In Example of Problem
/Users/malachi-at-rcvrc/config.json
)/Users/malachi-at-rcvrc/cvr.xlsx
)Suggested Solution
config.json
file in the command to run the CLI.config.json
file in relation to the$HOME
directory.The text was updated successfully, but these errors were encountered: