testmycode / tmc-cli

Command line client for tmc
MIT License
65 stars 21 forks source link

java.lang.ExceptionInInitializerError on `tmc download` #209

Closed varesa closed 8 years ago

varesa commented 8 years ago

Version: 0.3.0-SNAPSHOT / Sprintti3 OS: Fedora 23 Java:

$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)

Steps to reproduce:

$ wget https://github.com/tmc-cli/tmc-cli/releases/download/0.3.0-SNAPSHOT/tmc
$ ./tmc
$ . .bashrc

$ tmc login -s https://tmc.mooc.fi/mooc
username: varesa
password: 
Login succesful.

$ tmc download 2016-aalto-c
Exception in thread "main" java.lang.ExceptionInInitializerError
    at fi.helsinki.cs.tmc.langs.util.TaskExecutorImpl.getLanguagePlugin(TaskExecutorImpl.java:122)
    at fi.helsinki.cs.tmc.langs.util.TaskExecutorImpl.extractProject(TaskExecutorImpl.java:64)
    at fi.helsinki.cs.tmc.core.commands.DownloadOrUpdateExercises.call(DownloadOrUpdateExercises.java:80)
    at fi.helsinki.cs.tmc.core.commands.DownloadOrUpdateExercises.call(DownloadOrUpdateExercises.java:24)
    at fi.helsinki.cs.tmc.cli.tmcstuff.TmcUtil.downloadExercises(TmcUtil.java:68)
    at fi.helsinki.cs.tmc.cli.tmcstuff.TmcUtil.downloadAllExercises(TmcUtil.java:80)
    at fi.helsinki.cs.tmc.cli.command.DownloadExercisesCommand.run(DownloadExercisesCommand.java:50)
    at fi.helsinki.cs.tmc.cli.Application.runCommand(Application.java:78)
    at fi.helsinki.cs.tmc.cli.Application.run(Application.java:134)
    at fi.helsinki.cs.tmc.cli.Application.main(Application.java:195)
Caused by: java.lang.NullPointerException
    at fi.helsinki.cs.tmc.testscanner.TestScanner.<init>(TestScanner.java:82)
    at fi.helsinki.cs.tmc.testscanner.TestScanner.<init>(TestScanner.java:76)
    at fi.helsinki.cs.tmc.langs.java.maven.MavenPlugin.<init>(MavenPlugin.java:44)
    at fi.helsinki.cs.tmc.langs.util.ProjectType.<clinit>(ProjectType.java:21)
    ... 10 more
jamo commented 8 years ago

Could you please attach log from tmc-cli - it should be available at ~/.config/tmc-cli/logs/tmc-cli.log

jamo commented 8 years ago

The issue has been fixed in the underlying libraries and now in tmc-cli with de4607311624d8c6a38a5dc8baebf13abfca0ac4. We'll release a new release shortly with the bugfix.

juvester commented 8 years ago

Thanks for for submitting the issue varesa! Could you please try version 0.4.2, it should be fixed now.

varesa commented 8 years ago

~/.config/tmc-cli/logs/tmc-cli.log from old version:

2016-06-09 19:34:10 INFO TmcCore:87 - Creating new ListCourses command 2016-06-09 19:34:17 INFO TmcCore:87 - Creating new ListCourses command 2016-06-09 19:34:18 INFO TmcCore:82 - Creating new GetCourseDetails command 2016-06-09 19:34:18 INFO TmcCore:76 - Creating new DownloadOrUpdateExercises command

I tested the new version and it works:

[esa@esaf ~]$ tmc download 2016-aalto-c A new version of tmc-cli is available! Do you want to download it? (y/N): n Exception in thread "main" java.lang.ExceptionInInitializerError ...

[esa@esaf ~]$ alias tmc=/home/esa/tmc.new [esa@esaf ~]$ tmc download 2016-aalto-c [Module_1-02_intro, Module_1-04_func, ...

I also figured out that installing the package java-1.8.0-openjdk-develfixed the issue in the older version

jamo commented 8 years ago

Awesome 👍 , thanks for confirming the fix!