nus-cs2103-AY1819S2 / forum

CS2103/T discussion forum
6 stars 1 forks source link

EVERYTHING IS BROKEN #43

Open PhilipPhil opened 5 years ago

PhilipPhil commented 5 years ago

My project was running fine. I tried changing the name of a class from Type to Clothing Type. After that the entire thing wouldn't run. I couldn't just click edit undo so I tried reverting to a previous commit. For some reason SourceTree was saying that is not allowed so I decided to just delete and re-download the entire Main project. When I did this I changed 2 classes but didn't run the project before pushing to GitHub because I assumed it would work since it did in my first implementation before everything broke. Well now my project won't run at all! I do not know why so I tried to revert my project back to the version that worked. But that didn't seem to get rid of the code I wrote but just added more! Now I have no idea how to get back to a working version and I am totally confused and a about several hours of coding was deleted. Please help :(

fterh commented 5 years ago

Um I don't really understand what happened o.o

So you:

Anyway, you said "I changed 2 classes but didn't run the project before pushing to GitHub because I assumed it would work". So try cloning the repo into a new directory, reverting that commit (in bold), and seeing if it works. When I say commit I mean the command git revert. I don't know what's the Sourcetree UI to do that (I don't use sourcetree), you gotta google for the instructions.

Edit: if you're using the forking/branching workflow, you can just clone the master repo/branch, which SHOULD IDEALLY contain only tested changes, i.e. no development commits should ever go there. Your master repo/branch should always be production ready and serve as the "base" for all development. So if you didn't push your broken commit into your master repo/branch, you can just clone that and try.

What do you mean your project won't run? Error messages? What error messages do you see?

PhilipPhil commented 5 years ago

Mar 04, 2019 10:11:39 PM seedu.address.ui.UiManager start SEVERE: null java.lang.NullPointerException at seedu.address.ui.HelpWindow.(HelpWindow.java:31) at seedu.address.ui.HelpWindow.(HelpWindow.java:39) at seedu.address.ui.MainWindow.(MainWindow.java:69) at seedu.address.ui.UiManager.start(UiManager.java:41) at seedu.address.MainApp.start(MainApp.java:171) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175) at java.base/java.lang.Thread.run(Thread.java:844)

Mar 04, 2019 10:11:39 PM seedu.address.ui.UiManager showFatalErrorDialogAndShutdown SEVERE: Fatal error during initializing nullnull java.lang.NullPointerException at seedu.address.ui.HelpWindow.(HelpWindow.java:31) at seedu.address.ui.HelpWindow.(HelpWindow.java:39) at seedu.address.ui.MainWindow.(MainWindow.java:69) at seedu.address.ui.UiManager.start(UiManager.java:41) at seedu.address.MainApp.start(MainApp.java:171) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175) at java.base/java.lang.Thread.run(Thread.java:844)

Exception in Application start method Mar 04, 2019 10:11:39 PM seedu.address.MainApp stop INFO: ============================ [ Stopping Address Book ] ============================= java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:473) at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:372) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:945) Caused by: java.lang.RuntimeException: Exception in Application start method at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:973) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:198) at java.base/java.lang.Thread.run(Thread.java:844) Caused by: java.lang.NullPointerException at seedu.address.ui.UiManager.showAlertDialogAndWait(UiManager.java:56) at seedu.address.ui.UiManager.showFatalErrorDialogAndShutdown(UiManager.java:81) at seedu.address.ui.UiManager.start(UiManager.java:47) at seedu.address.MainApp.start(MainApp.java:171) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175) ... 1 more Exception running application seedu.address.MainApp

this is the error

PhilipPhil commented 5 years ago

I tried using Git Revert and it doesn't get rid of the new class I built. It doesn't run. Is it possible for me to just delete my entire main repository and just re branch from the group one? I'm just trying to get back to that at this point

PhilipPhil commented 5 years ago

howdoiget back to this

PhilipPhil commented 5 years ago

I want my project to look exactly like it did 4 hours ago at that point. How do I do that?

okkhoy commented 5 years ago

@PhilipPhil find the commit that worked and reset to that?

PhilipPhil commented 5 years ago

I tried doing that already but for some reason it still keeps the new class that I build and even if I try deleting that class it doesn't run.

PhilipPhil commented 5 years ago

I merged the project then made a commit when the project was broken. I'm trying to get my project to look like it did when I merged.

fterh commented 5 years ago

Try:

  1. cd to a new directory entirely
  2. git clone the repo
  3. git checkout 94a2df8

See if this works. Also, you might want to consider setting up branch protection to protect your master branch from failing builds, i.e. only allow passing builds to be merged.

PhilipPhil commented 5 years ago

I don't know how to use git on terminal

fterh commented 5 years ago

Time to google then. git-scm.com and stackoverflow should be more than enough. UI is nice and pretty for most things but sometimes they just won't be enough to do certain things.

PhilipPhil commented 5 years ago

I delete my entire repository from my PC and github. I did everything all over again and now the project still isent running!

fterh commented 5 years ago

Have you tried this??????

https://github.com/nus-cs2103-AY1819S2/forum/issues/43#issuecomment-469279730

PhilipPhil commented 5 years ago

this is not my problem anymore. I forked and did everything from the beginning. This error is my problem.

INFO: Starting UI... Mar 04, 2019 11:28:45 PM seedu.address.ui.UiManager start SEVERE: null java.lang.NullPointerException at seedu.address.ui.HelpWindow.(HelpWindow.java:31) at seedu.address.ui.HelpWindow.(HelpWindow.java:39) at seedu.address.ui.MainWindow.(MainWindow.java:69) at seedu.address.ui.UiManager.start(UiManager.java:41) at seedu.address.MainApp.start(MainApp.java:171) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175) at java.base/java.lang.Thread.run(Thread.java:844)

Mar 04, 2019 11:28:45 PM seedu.address.ui.UiManager showFatalErrorDialogAndShutdown SEVERE: Fatal error during initializing nullnull java.lang.NullPointerException at seedu.address.ui.HelpWindow.(HelpWindow.java:31) at seedu.address.ui.HelpWindow.(HelpWindow.java:39) at seedu.address.ui.MainWindow.(MainWindow.java:69) at seedu.address.ui.UiManager.start(UiManager.java:41) at seedu.address.MainApp.start(MainApp.java:171) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175) at java.base/java.lang.Thread.run(Thread.java:844)

Exception in Application start method Mar 04, 2019 11:28:45 PM seedu.address.MainApp stop INFO: ============================ [ Stopping Address Book ] ============================= java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:473) at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:372) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:945) Caused by: java.lang.RuntimeException: Exception in Application start method at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:973) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:198) at java.base/java.lang.Thread.run(Thread.java:844) Caused by: java.lang.NullPointerException at seedu.address.ui.UiManager.showAlertDialogAndWait(UiManager.java:56) at seedu.address.ui.UiManager.showFatalErrorDialogAndShutdown(UiManager.java:81) at seedu.address.ui.UiManager.start(UiManager.java:47) at seedu.address.MainApp.start(MainApp.java:171) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175) ... 1 more Exception running application seedu.address.MainApp

okkhoy commented 5 years ago

The error message seems to be the same as the one posted earlier. So I am not sure if delete+fork+redo did any good to you.

Just checking did you set up the project correctly after delete+fork+clone, by following all the steps mentioned?

eugenefdw commented 5 years ago

@PhilipPhil When you did a commit reset, did you try a hard reset? image

PhilipPhil commented 5 years ago

yes I did hard reset. I re-forked from are group project that ran correctly. I'm loaded the project the same as before. build.gradle and used all default settings. Also even none of my merges seem to work even if I just change one string. I'm still getting errors

rlrh commented 5 years ago

@PhilipPhil The good news is that the solution is very simple. The problem you're currently facing likely doesn't have anything to do with the changes you made. You forgot to run ./gradlew processResources on Mac/Linux or gradlew processResources on Windows. In IntelliJ, open your project, click on the terminal tab at the bottom and input the above command. You should be able to run MainApp after this. Have a look at the 'Setting up' section in the Developer Guide.