pbauerochse / youtrack-worklog-viewer

A tool to keep track of the work hours you spent on issues in the YouTrack issue management system
MIT License
39 stars 10 forks source link

NullPointerException on initial load #19

Closed pmalouin closed 6 years ago

pmalouin commented 8 years ago

My colleague is getting a NullPointerException when loading the worklog report. Here is an excerpt of the log file:

09:01:19.616 [JavaFX Application Thread] WARN  d.p.w.fx.MainViewController - Task FetchTimereport-Task failed
09:01:19.617 [JavaFX Application Thread] WARN  d.p.w.fx.MainViewController - Error executing task de.pbauerochse.worklogviewer.fx.tasks.FetchTimereportTask@599a5d08
java.lang.NullPointerException: null
 at de.pbauerochse.worklogviewer.youtrack.createreport.request.CreateReportRequestEntity.<init>(CreateReportRequestEntity.java:30) ~[youtrack-worklog-viewer-2.2.2.jar:na]
 at de.pbauerochse.worklogviewer.fx.tasks.FetchTimereportTask.call(FetchTimereportTask.java:45) ~[youtrack-worklog-viewer-2.2.2.jar:na]
 at de.pbauerochse.worklogviewer.fx.tasks.FetchTimereportTask.call(FetchTimereportTask.java:23) ~[youtrack-worklog-viewer-2.2.2.jar:na]
 at javafx.concurrent.Task$TaskCallable.call(Task.java:1423) ~[jfxrt.jar:na]
 at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.8.0_101]
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[na:1.8.0_101]
 at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.8.0_101]
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:1.8.0_101]
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:1.8.0_101]
 at java.lang.Thread.run(Unknown Source) ~[na:1.8.0_101]
09:01:21.754 [JavaFX Application Thread] DEBUG d.p.w.fx.MainViewController - Showing log messages dialogue
09:01:21.781 [JavaFX Application Thread] DEBUG d.p.w.fx.LogViewController - Initializing
09:01:21.787 [JavaFX Application Thread] DEBUG d.p.w.fx.LogViewController - Adding WindowChangeListener

I looked at the source of CreateReportRequestEntity.java:30 and I don't see an obvious explanation of the problem. Next step would be to debug the code to find out which variable is null, unless you have an idea as to why this user can't load the report even though I was able to load it myself (with a different user credentials).

I also saw that #11 experienced the same exception but there is nothing in that issue that might explain our problem.

We're using the hosted/cloud version of YouTrack (myjetbrains.com) that is at the following version:

YouTrack 6.5 Build 17122 19-Jul-2016 21:22

Thanks!

pmalouin commented 8 years ago

After investigating a little bit, we found out that my colleague had entered a wrong password and after correcting it, the report can be generated successfully... This is odd because earlier, we tried entering a wrong password and received an error saying the credentials were wrong. We initially thought the NullPointerException was unrelated to the credentials because we saw this error message.

I let you decide if this issue should be closed or if more investigation should be done to find the cause of the NPE, and if the error handling could be improved in this specific case.