nus-cs2103-AY2021S2 / forum

10 stars 0 forks source link

Failing CI due to NPE and `java.lang.NoClassDefFoundError` #295

Open lue97 opened 3 years ago

lue97 commented 3 years ago

I've conducted tests on both Windows and Linux locally and both passes with no issues. It however happens when I push it to Github.

> Task :test

seedu.address.logic.commands.DeletePictureCommandTest > initializationError FAILED
    java.lang.ExceptionInInitializerError at DeletePictureCommandTest.java:35
        Caused by: java.lang.NullPointerException at DeletePictureCommandTest.java:35

seedu.address.logic.commands.AddDateCommandTest > execute_invalidPersonIndexUnfilteredList_failure() FAILED
    java.lang.NoClassDefFoundError at AddDateCommandTest.java:32

seedu.address.logic.commands.AddDateCommandTest > execute_validSpecialDates_success() FAILED
    java.lang.NoClassDefFoundError at AddDateCommandTest.java:32

Did anyone encounter the same issue? This is the PR I'm referring to.

damithc commented 3 years ago

Just a tip: Look at the commits page of the PR to identify at which commit the CI started failing first. Hopefully, that commit has a smaller diff compared to the full diff of the PR. The cause of the problems is likely to be within the code you changed in that commit.

godjuansan commented 3 years ago

I think it is a good idea to commit codes every once in a while. This is to make sure you can easily track which part of code is wrong since if a code works in commit #n and fails at #(n+1), then it is very likely that the one failing it is whatever you are writing between those 2 commits. Hence, the lower the number of lines between those transitions, the easier you can find the impostor code :)

jessen11 commented 3 years ago

Usually, NoClassDefFoundError means that the class exists compile time, but not runtime. Do you add things manually by chance? Also, a little bit unrelated, but CI can somehow randomly fails because of server failure. You can try to re run all jobs, maybe it helps. Good luck :D

jessen11 commented 3 years ago

Usually, NoClassDefFoundError means that the class exists compile time, but not runtime. Do you add things manually by chance? Also, a little bit unrelated, but CI can somehow randomly fails because of server failure. You can try to re run all jobs, maybe it helps. Good luck :D