{"action":"created","issue":{"url":"https://api.github.com/repos/nusCS2113-AY1819S1/forum/issues/72","repository_url":"https://api.github.com/repos/nusCS2113-AY1819S1/forum","labels_url":"https://api.github.com/repos/nusCS2113-AY1819S1/forum/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/nusCS2113-AY1819S1/forum/issues/72/comments","events_url":"https://api.github.com/repos/nusCS2113-AY1819S1/forum/issues/72/events","html_url":"https://github.com/nusCS2113-AY1819S1/forum/issues/72","id":373400053,"node_id":"MDU6SXNzdWUzNzM0MDAwNTM=","number":72,"title":"Issue with opening jar file (JSON related)","user":{"login":"LIU-TIANHANG","id":32838530,"node_id":"MDQ6VXNlcjMyODM4NTMw","avatar_url":"https://avatars0.githubusercontent.com/u/32838530?v=4","gravatar_id":"","url":"https://api.github.com/users/LIU-TIANHANG","html_url":"https://github.com/LIU-TIANHANG","followers_url":"https://api.github.com/users/LIU-TIANHANG/followers","following_url":"https://api.github.com/users/LIU-TIANHANG/following{/other_user}","gists_url":"https://api.github.com/users/LIU-TIANHANG/gists{/gist_id}","starred_url":"https://api.github.com/users/LIU-TIANHANG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LIU-TIANHANG/subscriptions","organizations_url":"https://api.github.com/users/LIU-TIANHANG/orgs","repos_url":"https://api.github.com/users/LIU-TIANHANG/repos","events_url":"https://api.github.com/users/LIU-TIANHANG/events{/privacy}","received_events_url":"https://api.github.com/users/LIU-TIANHANG/received_events","type":"User","site_admin":false},"labels":[{"id":1013509578,"node_id":"MDU6TGFiZWwxMDEzNTA5NTc4","url":"https://api.github.com/repos/nusCS2113-AY1819S1/forum/labels/Help%20request","name":"Help request","color":"7057ff","default":false},{"id":1013509574,"node_id":"MDU6TGFiZWwxMDEzNTA5NTc0","url":"https://api.github.com/repos/nusCS2113-AY1819S1/forum/labels/Question","name":"Question","color":"04b2f7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-24T09:55:26Z","updated_at":"2018-10-25T13:34:25Z","closed_at":null,"author_association":"NONE","body":"Good day, I have implement a additional JSON file to read and write from. It works fine with idea. However, when I export to Jar. I get the following message when try to open Jar file (java -jar main.jar):\r\nOct 24, 2018 12:09:34 PM seedu.address.MainApp init\r\nINFO: =============================[ Initializing AddressBook ]===========================\r\nOct 24, 2018 12:09:34 PM seedu.address.MainApp initConfig\r\nINFO: Using config file : config.json\r\nOct 24, 2018 12:09:35 PM seedu.address.MainApp initPrefs\r\nINFO: Using prefs file : preferences.json\r\nOct 24, 2018 12:09:35 PM seedu.address.MainApp initLoginInfo\r\nINFO: Using Login information file : loginInfoManager.json\r\nOct 24, 2018 12:09:35 PM seedu.address.commons.util.JsonUtil readJsonFile\r\nINFO: Json file loginInfoManager.json not found\r\nException in Application init method\r\njava.lang.reflect.InvocationTargetException\r\n        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\r\n        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\r\n        at java.base/java.lang.reflect.Method.invoke(Unknown Source)\r\n        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)\r\n        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)\r\n        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\r\n        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\r\n        at java.base/java.lang.reflect.Method.invoke(Unknown Source)\r\n        at java.base/sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)\r\nCaused by: java.lang.RuntimeException: Exception in Application init method\r\n        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)\r\n        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)\r\n        at java.base/java.lang.Thread.run(Unknown Source)\r\nCaused by: java.util.NoSuchElementException: No value present\r\n        at java.base/java.util.Optional.get(Unknown Source)\r\n        at seedu.address.storage.logininfo.JsonLoginInfoStorage.readLoginInfo(JsonLoginInfoStorage.java:35)\r\n        at seedu.address.storage.logininfo.JsonLoginInfoStorage.readLoginInfo(JsonLoginInfoStorage.java:27)\r\n        at seedu.address.MainApp.initLoginInfo(MainApp.java:146)\r\n        at seedu.address.MainApp.init(MainApp.java:85)\r\n        ... 3 more\r\nException running application seedu.address.MainApp\r\n\r\nMay I check is there any additional things I need to do before build JAR?\r\nPs: I follow https://www.youtube.com/watch?v=zf7bFiPOKvc for building jar"},"comment":{"url":"https://api.github.com/repos/nusCS2113-AY1819S1/forum/issues/comments/433053059","html_url":"https://github.com/nusCS2113-AY1819S1/forum/issues/72#issuecomment-433053059","issue_url":"https://api.github.com/repos/nusCS2113-AY1819S1/forum/issues/72","id":433053059,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzA1MzA1OQ==","user":{"login":"LIU-TIANHANG","id":32838530,"node_id":"MDQ6VXNlcjMyODM4NTMw","avatar_url":"https://avatars0.githubusercontent.com/u/32838530?v=4","gravatar_id":"","url":"https://api.github.com/users/LIU-TIANHANG","html_url":"https://github.com/LIU-TIANHANG","followers_url":"https://api.github.com/users/LIU-TIANHANG/followers","following_url":"https://api.github.com/users/LIU-TIANHANG/following{/other_user}","gists_url":"https://api.github.com/users/LIU-TIANHANG/gists{/gist_id}","starred_url":"https://api.github.com/users/LIU-TIANHANG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LIU-TIANHANG/subscriptions","organizations_url":"https://api.github.com/users/LIU-TIANHANG/orgs","repos_url":"https://api.github.com/users/LIU-TIANHANG/repos","events_url":"https://api.github.com/users/LIU-TIANHANG/events{/privacy}","received_events_url":"https://api.github.com/users/LIU-TIANHANG/received_events","type":"User","site_admin":false},"created_at":"2018-10-25T13:34:25Z","updated_at":"2018-10-25T13:34:25Z","author_association":"NONE","body":"> @LIU-TIANHANG I mitigated the problem by making my app write a default file in case it is not present. Can you try that?\r\n\r\nHmm, I can try that. But does is solve the problem of not finding the file? As it overwrite every time because file is not found, it seem to violate the purpose of storage. "}}
{"actor":{"display_login":"LIU-TIANHANG"}}