Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu "Open terminal here" causes an uncaught exception #8466

Closed
2 tasks done
mlep opened this issue Jan 26, 2022 · 6 comments · Fixed by #8492
Closed
2 tasks done

Menu "Open terminal here" causes an uncaught exception #8466

mlep opened this issue Jan 26, 2022 · 6 comments · Fixed by #8492
Labels
bug Confirmed bugs or reports that are very likely to be bugs good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects

Comments

@mlep
Copy link
Contributor

mlep commented Jan 26, 2022

JabRef version

Latest development branch build (please note build date below)

Operating system

GNU / Linux

Details on version and operating system

JabRef 5.6--2022-01-25--2c92eb0 Linux 4.19.0-18-amd64 amd64 Java 16.0.2 JavaFX 17.0.1+1

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Open a file
  2. Select the menu View -> Open terminal here

No terminal opens, and a window opens, showing that an exception is raised:

Uncaught exception occurred in Thread[JavaFX Application Thread,5,main]]
Cannot invoke "java.util.function.Supplier.get()" because "this.databaseContext" is null

Appendix

...

Log FileFix SSL exceptions by accepting ALL certificates Not updating theme because it hasn't changed Theme set to Theme{type=EMBEDDED, name='Dark.css'} with base css StyleSheet{jrt:/org.jabref/org/jabref/gui/Base.css} Index path for /home/USER/Documents/Biblio/jabref-authors.bib is /home/USER/.local/share/JabRef/0.5a Could not find geiger2016evolution.pdf Could not find Geiger2016ProcessEngineBenchmarking.pdf Could not find Nikol2016.pdf Could not find Geiger2015BPMNConformanceIn.pdf Could not find Harrer2015ImprovingStaticAnalysis.pdf Could not find Harrer2014AutomatedandIsolated.pdf Could not find Harrer2014BPELConformancein.pdf Could not find Roeck2014PerformanceBenchmarkingBPEL.pdf Could not find Harrer2014ProcessEngineSelection.pdf Could not find Preissinger2014StaticAnalysisRules.pdf Could not find Roeck2014TestingBPELEngine.pdf Could not find Harrer2014TowardsRobustnessEvaluation.pdf Could not find Kolb2014TowardsApplicationPortability.pdf Could not find Preissinger2014BPELStaticAnalysisProposal.pdf Could not find Harrer2014TowardsUniformBPEL.pdf Could not find Geiger2013BPMN20Process.pdf Could not find Geiger2013BPMN20Serialization.pdf Could not find Geiger2013DetectingInteroperabilityand.pdf Could not find Lenhard2013DetectingPortabilityIssues.pdf Could not find Lenhard2013MeasuringInstallabilityService.pdf Could not find Lenhard2013MeasuringPortabilityof.pdf Could not find Harrer2013OpenSourceversus.pdf Could not find Harrer2012BetsyBPELEngine.pdf Could not find Harrer2012BPELconformancein.pdf Could not find Kolb2012BridgingHeterogeneityOrchestrations.pdf Could not find Geiger2011ProposalCheckingConformance.pdf Could not find Lenhard2011EditDistanceBased.pdf Could not find Schoenberger2011HasWSIs.pdf Could not find Geiger2011TowardsAutomatedConformance.pdf Could not find Benker2009.pdf Uncaught exception occurred in Thread[JavaFX Application Thread,5,main] java.lang.NullPointerException: Cannot invoke "java.util.function.Supplier.get()" because "this.databaseContext" is null at [email protected]/org.jabref.gui.OpenConsoleAction.execute(Unknown Source) at [email protected]/org.jabref.gui.actions.JabRefAction.lambda$new$3(Unknown Source) at [email protected]/org.controlsfx.control.action.Action.handle(Unknown Source) at [email protected]/org.controlsfx.control.action.Action.handle(Unknown Source) at [email protected]/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source) at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at [email protected]/javafx.event.Event.fireEvent(Unknown Source) at [email protected]/javafx.scene.control.MenuItem.fire(Unknown Source) at [email protected]/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(Unknown Source) at [email protected]/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(Unknown Source) at [email protected]/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source) at [email protected]/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source) at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at [email protected]/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source) at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at [email protected]/javafx.event.Event.fireEvent(Unknown Source) at [email protected]/javafx.scene.Scene$MouseHandler.process(Unknown Source) at [email protected]/javafx.scene.Scene.processMouseEvent(Unknown Source) at [email protected]/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source) at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source) at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source) at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source) at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source) at [email protected]/com.sun.glass.ui.View.handleMouseEvent(Unknown Source) at [email protected]/com.sun.glass.ui.View.notifyMouse(Unknown Source) at [email protected]/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at [email protected]/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)
@Siedlerchr Siedlerchr added entry-editor os: linux bug Confirmed bugs or reports that are very likely to be bugs good first issue An issue intended for project-newcomers. Varies in difficulty. and removed entry-editor labels Jan 26, 2022
@Siedlerchr Siedlerchr added this to Normal priority in Bugs via automation Jan 26, 2022
@RyanEubank
Copy link
Contributor

Hello @Siedlerchr, I can confirm this issue persists on Windows 10 when using the latest portable version:

JabRef 5.6--2022-01-30--8ca6b7f
Windows 10 10.0 amd64
Java 16.0.2
JavaFX 17.0.2-ea+3

and is reproduced using the steps above in the original post.

I would like to look into this issue myself if possible; I have never contributed to an open source project before but I am quite familiar with Java and see this listed as a good first issue. I am currently reading documentation and familiarizing myself with JabRef's codebase, do you have any other suggestions to get me started?

@ThiloteE
Copy link
Member

ThiloteE commented Jan 31, 2022

Thank you! I will let Christoph answer your questions, but i just want to add something that might help in solving this:

  • ctrl + shift + L still works.
  • Also, right clicking on a library file and opening a terminal from the corresponding submenu also works.
    image

The only command that fails seems to be view > open terminal here

@Siedlerchr
Copy link
Member

@RyanEubank Welcome to JabRef! From the stack strace it seems the issue arose somewhere here.
https://github.com/JabRef/jabref/blob/main/src/main/java/org/jabref/gui/actions/JabRefAction.java

For getting started, just follow the contribution guide: https://devdocs.jabref.org/contributing#contribute-code

@RyanEubank
Copy link
Contributor

Thanks, I believe I found and fixed the issue; just a simple one line change. However, I've noticed the master branch fails a few tests when running gradlew check, unrelated to any changes here. Is this an issue before submitting any pull requests?

@Siedlerchr
Copy link
Member

@RyanEubank no worries, if the Unit test pass on CI/ GitHub action it's fine.

RyanEubank added a commit to RyanEubank/jabref that referenced this issue Feb 8, 2022
The change fixes an issue where opening the console at the current library caused a null reference exception. The original error occurred due to an explicit null value being passed into the action's constructor. The fix supplies the correct database to the action when called.

See: JabRef#8466
RyanEubank added a commit to RyanEubank/jabref that referenced this issue Feb 8, 2022
Added Junit tests cases to verify that commands retrieve the correct database, and that the command defaults to the active database otherwise.

Tests cases added in response to a bug fix, see: JabRef#8466
Bugs automation moved this from Normal priority to Done Feb 9, 2022
Siedlerchr pushed a commit that referenced this issue Feb 9, 2022
* Fix an issue opening console from menu

The change fixes an issue where opening the console at the current library caused a null reference exception. The original error occurred due to an explicit null value being passed into the action's constructor. The fix supplies the correct database to the action when called.

See: #8466

* Add unit test for opening console

Added Junit tests cases to verify that commands retrieve the correct database, and that the command defaults to the active database otherwise.

Tests cases added in response to a bug fix, see: #8466

* Update CHANGELOG.md

Update for style correction

* Update CHANGELOG.md
@mlep
Copy link
Contributor Author

mlep commented Feb 9, 2022

I can confirm the issue is now fixed
Thanks @RyanEubank!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects
Archived in project
Bugs
  
Done
Development

Successfully merging a pull request may close this issue.

4 participants