jabref: "open folder" causes java.lang.NullPointerException: null
JabRef–master–latest.jar (https://builds.jabref.org/master/) as well as version 4.3.1-2 form Arch AUR (https://aur.archlinux.org/packages/jabref/)
- I have tested the latest development version from http://builds.jabref.org/master/ and the problem persists
Right clicking on any entry in any database and selecting “Open folder” results in the NullPointer exception below. The setup experiencing this problem is Arch Linux with i3 window manager and without desktop environment. Hence it could be that there is a dependency to some external SW that is not satisfied. This problem exists over multiple version already (~1y) over different Arch machines I operate. My guess is that there is some unknown dependency that I lack on my systems, which causes “open folder” to silently crash. I would be interested in tracking down what exactly is causing that issue. Might be something very obvious to you guys.
Steps to reproduce the behavior:
- On Arch Linux + Jabref master latest or Jabref 4.3.1-2 from AUR: open any database where files have associated pdfs in their entires.
- Right click, “open folder” --> exception below
Log File
10:51:41.270 [JabRef CachedThreadPool] ERROR org.jabref.FallbackExceptionHandler - Uncaught exception occurred in Thread[JabRef CachedThreadPool,5,main]
java.lang.NullPointerException: null
at org.jabref.gui.desktop.os.Linux.openFolderAndSelectFile(Linux.java:54) ~[JabRef--master--latest.jar:?]
at org.jabref.gui.desktop.JabRefDesktop.openFolderAndSelectFile(JabRefDesktop.java:171) ~[JabRef--master--latest.jar:?]
at org.jabref.gui.BasePanel.lambda$null$49(BasePanel.java:348) ~[JabRef--master--latest.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_201]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
Used Java version:
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
I’m happy to provide further details!
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (14 by maintainers)
Commits related to this issue
- issue #4763 — committed to deepakkumar96/jabref by deepakkumar96 5 years ago
- Fix #4763 and add added required changes in CHANGELOG.md and JabRef_en.properties — committed to deepakkumar96/jabref by deepakkumar96 5 years ago
- Fix right clicking on any entry and selecting "Open folder" results in the NullPointer exception (#4797) * Add an option in preference settings to set what action to be taken by JabRef when user clic... — committed to JabRef/jabref by deepakkumar96 5 years ago
- Squashed 'src/main/resources/csl-styles/' changes from 906cd6d43d..cb19d25ef7 cb19d25ef7 Create revista-biblica.csl (#4763) d40b5ffa87 Small corrections in IFAO style (#4761) ba4dd7c6e2 Add NZ Journa... — committed to dimitra-karadima/jabref by deleted user 4 years ago
- Squashed 'src/main/resources/csl-styles/' changes from 906cd6d43d..cb19d25ef7 cb19d25ef7 Create revista-biblica.csl (#4763) d40b5ffa87 Small corrections in IFAO style (#4761) ba4dd7c6e2 Add NZ Journa... — committed to dimitra-karadima/jabref by deleted user 4 years ago
- Squashed 'src/main/resources/csl-styles/' changes from 906cd6d43d..270cd3209b 270cd3209b small fixes for revista-biblica.csl (#4770) 5dd7ede773 fix issue with DOI URL for unified-style-sheet-for-ling... — committed to leitianjian/jabref by deleted user 4 years ago
- Squashed 'src/main/resources/csl-styles/' changes from 906cd6d43d..270cd3209b 270cd3209b small fixes for revista-biblica.csl (#4770) 5dd7ede773 fix issue with DOI URL for unified-style-sheet-for-ling... — committed to JabRef/jabref by deleted user 4 years ago
- Squashed 'src/main/resources/csl-styles/' changes from 1e20dbd39b..c35d21968c c35d21968c Create journal-of-the-royal-society-of-western-australia.csl (#4772) e772607ae9 Update journal-of-the-royal-so... — committed to dextep/jabref by deleted user 4 years ago
- Squashed 'src/main/resources/csl-styles/' changes from 906cd6d43d..586e0b8408 586e0b8408 Reindent/reorder 56cd2cbd3b small fixes for skene-journal-of-theatre-and-drama-studies.csl (#4779) 31ab72fbdb ... — committed to ShikunXiong/jabref by deleted user 4 years ago
- Squashed 'src/main/resources/csl-styles/' changes from 906cd6d43d..586e0b8408 586e0b8408 Reindent/reorder 56cd2cbd3b small fixes for skene-journal-of-theatre-and-drama-studies.csl (#4779) 31ab72fbdb ... — committed to CaptainDaVinci/jabref by deleted user 4 years ago
- Squashed 'src/main/resources/csl-styles/' changes from 906cd6d43d..586e0b8408 586e0b8408 Reindent/reorder 56cd2cbd3b small fixes for skene-journal-of-theatre-and-drama-studies.csl (#4779) 31ab72fbdb ... — committed to NikodemKch/jabref-1 by deleted user 4 years ago
- Squashed 'src/main/resources/csl-styles/' changes from 906cd6d43d..586e0b8408 586e0b8408 Reindent/reorder 56cd2cbd3b small fixes for skene-journal-of-theatre-and-drama-studies.csl (#4779) 31ab72fbdb ... — committed to eetian/jabref by deleted user 4 years ago
- Squashed 'src/main/resources/csl-styles/' changes from 906cd6d43d..586e0b8408 586e0b8408 Reindent/reorder 56cd2cbd3b small fixes for skene-journal-of-theatre-and-drama-studies.csl (#4779) 31ab72fbdb ... — committed to dextep/jabref by deleted user 4 years ago
Now, when user clicks “open folder”, JabRef will try to look whether file browser command(in Preference Tab) is explicitly set by the user or not, If yes then it will execute that command otherwise default behaviour will be applied by checking “DESKTOP_SESSION” environment variable. So Is this solution correct or Do I have to find some other way?
@Siedlerchr now I understand. I neither have nautilus installed nor is my DESKTOP_SESSION set. My suggestion would be:
in the preferences in external programs give an option for which command is executed when “open folder” is selected. This way on Linux you would not be bound to any specific file browser. You could include the path to the file selected in JabRef as a variable in that command: this way users would be able to choose where in the command the path to the selected file is used. This is similar to how e.g. Kile handles external programs like file browsers, pdf vieweres, etc, should you be familiar with Kile.
in situations where you need to anyway rely on those external environment variables and external programs to be present, maybe make the exception descriptive. I just realized with the code above that setting my DESKTOP_SESSION and installing Nautilus or similar might have solved the problem 😃
I would not recommend on hard coding any terminal - this would lead to similar issues as with file browsers (people used different terminals). Giving users choice - maybe with reasonable defaults, to this I agree - would cover more of those corner cases in my opinion.
Hello, I’m new to open source and interested in contributing to JabRef.I would like to work on this issue, So please allow me to work on it.
@CaptainDaVinci It should open the default file manager of the OS and select the file. e.g. on Windows it opens the explorer and selects the file: (The file is not related to the entry, just for demonstration purposes)
@pirius It seems like this is a classical NPE because the environment variable
DESKTOP_SESSION
is not set. I’m not a Linux expert, so you may have an idea for a better implementation:https://github.com/JabRef/jabref/blob/7ed15bc4a257bc724c5d4f1cf7d872fad7cb07e7/src/main/java/org/jabref/gui/desktop/os/Linux.java#L53-L66