PostgreSQL connection - JabRef 4.0, 4.1, 4.2

I can’t connect to certain PostgreSQL servers with JabRef 4.0 & 4.1 & JabRef-4.2-dev–snapshot–2018-04-04–master–fe90b1a0e.jar.

Let me know if you think this is a bug and should be reported on https://github.com/JabRef/jabref/issues.

If I install PostgreSQL 9.6 onto my local machine (from the EnterpriseDB postgresql-9.6.8-1-windows-x64.exe) I can connect to it using e.g. DBeaver and pgAdmin4 but when I go into JabRef 4.2, 4.1 or 4.0 and do:

File>Connect to shared database
Library type: PostgreSQL
Host: localhost
Port: 5432
Library: postgres
User: postgres
Password: xxxxx

It will hang at that window at “Connecting…”, no tables will be created and the sessions tab in pgAdmin4 shows only one process for “pgjdbc app” with Status=idle.

The same happens when I try to connect to a PostgreSQL server with JabRef 4.0-4.2 from a different machine on my network.

I’m using jre1.8.0_162 but have also got the same results with 152 and 161.

However, I can connect to the server using JabRef versions 3.6, 3.7, 3.8, 3.8.1, 3.8.2. JabRef will connect almost straight away, create three tables (ENTRY, FIELD & METADATA) in the public schema and show up in the sessions tab in pgAdmin4 as two (sometimes one) processes for “pgjdbc app” with Status=idle.

Also, if I create a free PostgreSQL instance on elephantsql(dot)com I can go into JabRef 4.0-4.2 and do:

File>Connect to shared database
Library type: PostgreSQL
Host: elephantsql url
Port: 5432
Library: the name of my default database
User: the name of my default user (same as my default database)
Password: xxxxx

And JabRef will connect almost straight away, create three tables (ENTRY, FIELD & METADATA) in the public schema and show up in the sessions tab in pgAdmin4 as two processes for “pgjdbc app” with Status=idle.

The elephantsql instance was “PostgreSQL 9.4.1 on x86_64-unknown-linux-gpu, compiled by gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2, 64-bit”

If I run “java -jar JabRef-4.1.jar -d all” at the command line I get:

Setting all preferences to default values.
File: grouptree.fxml not found, attempting with camel case
File: grouptree.css not found, attempting with camel case

and then when I try to connect to the postgresql database from JabRef I get:

10:36:23.825 [AWT-EventQueue-0] ERROR org.jabref.FallbackExceptionHandler - Uncaught exception occurred in Thread[AWT-EventQueue-0,6,main]
java.lang.NullPointerException: null
        at com.impossibl.postgres.system.BasicContext.loadLocale(BasicContext.java:294) ~[JabRef-4.1.jar:?]
        at com.impossibl.postgres.system.BasicContext.init(BasicContext.java:273) ~[JabRef-4.1.jar:?]
        at com.impossibl.postgres.jdbc.PGConnectionImpl.init(PGConnectionImpl.java:251) ~[JabRef-4.1.jar:?]
        at com.impossibl.postgres.jdbc.ConnectionUtil.createConnection(ConnectionUtil.java:182) ~[JabRef-4.1.jar:?]
        at com.impossibl.postgres.jdbc.PGDriver.connect(PGDriver.java:78) ~[JabRef-4.1.jar:?]
        at com.impossibl.postgres.jdbc.PGDriver.connect(PGDriver.java:53) ~[JabRef-4.1.jar:?]
        at java.sql.DriverManager.getConnection(Unknown Source) ~[?:1.8.0_162]
        at java.sql.DriverManager.getConnection(Unknown Source) ~[?:1.8.0_162]
        at org.jabref.shared.DBMSConnection.<init>(DBMSConnection.java:36) ~[JabRef-4.1.jar:?]
        at org.jabref.shared.DBMSSynchronizer.openSharedDatabase(DBMSSynchronizer.java:360) ~[JabRef-4.1.jar:?]
        at org.jabref.gui.shared.SharedDatabaseUIManager.openNewSharedDatabaseTab(SharedDatabaseUIManager.java:112) ~[JabRef-4.1.jar:?]
        at org.jabref.gui.shared.ConnectToSharedDatabaseDialog.openSharedDatabase(ConnectToSharedDatabaseDialog.java:143) ~[JabRef-4.1.jar:?]
        at org.jabref.gui.shared.ConnectToSharedDatabaseDialog$1.actionPerformed(ConnectToSharedDatabaseDialog.java:185) ~[JabRef-4.1.jar:?]
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) ~[?:1.8.0_162]
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) ~[?:1.8.0_162]
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) ~[?:1.8.0_162]
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source) ~[?:1.8.0_162]
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Component.processMouseEvent(Unknown Source) ~[?:1.8.0_162]
        at javax.swing.JComponent.processMouseEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Component.processEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Container.processEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Component.dispatchEventImpl(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Container.dispatchEventImpl(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Component.dispatchEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Container.dispatchEventImpl(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Window.dispatchEventImpl(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Component.dispatchEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventQueue.access$500(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventQueue$3.run(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventQueue$3.run(Unknown Source) ~[?:1.8.0_162]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_162]
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) ~[?:1.8.0_162]
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventQueue$4.run(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventQueue$4.run(Unknown Source) ~[?:1.8.0_162]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_162]
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventQueue.dispatchEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) ~[?:1.8.0_162]
        at java.awt.WaitDispatchSupport$2.run(Unknown Source) ~[?:1.8.0_162]
        at java.awt.WaitDispatchSupport$4.run(Unknown Source) ~[?:1.8.0_162]
        at java.awt.WaitDispatchSupport$4.run(Unknown Source) ~[?:1.8.0_162]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_162]
        at java.awt.WaitDispatchSupport.enter(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Dialog.show(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Component.show(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Component.setVisible(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Window.setVisible(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Dialog.setVisible(Unknown Source) ~[?:1.8.0_162]
        at org.jabref.gui.actions.ConnectToSharedDatabaseAction.actionPerformed(ConnectToSharedDatabaseAction.java:29) ~[JabRef-4.1.jar:?]
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) ~[?:1.8.0_162]
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) ~[?:1.8.0_162]
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) ~[?:1.8.0_162]
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source) ~[?:1.8.0_162]
        at javax.swing.AbstractButton.doClick(Unknown Source) ~[?:1.8.0_162]
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source) ~[?:1.8.0_162]
        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source) ~[?:1.8.0_162]
        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Component.processMouseEvent(Unknown Source) ~[?:1.8.0_162]
        at javax.swing.JComponent.processMouseEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Component.processEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Container.processEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Component.dispatchEventImpl(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Container.dispatchEventImpl(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Component.dispatchEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Container.dispatchEventImpl(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Window.dispatchEventImpl(Unknown Source) ~[?:1.8.0_162]
        at java.awt.Component.dispatchEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventQueue.access$500(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventQueue$3.run(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventQueue$3.run(Unknown Source) ~[?:1.8.0_162]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_162]
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) ~[?:1.8.0_162]
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventQueue$4.run(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventQueue$4.run(Unknown Source) ~[?:1.8.0_162]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_162]
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventQueue.dispatchEvent(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source) ~[?:1.8.0_162]
        at java.awt.EventDispatchThread.run(Unknown Source) ~[?:1.8.0_162]

Hi,

thanks for the report. Judging from the error log, it looks like a problem with the Locale of your postgres database. The exception seems to come directly from the driver, and seems to be already fixed with a development version of the driver. However, the new version is not yet released. Either you wait for a new snapshot (I asked if they release one) or you compile the driver yourselves and add it do jabref as dep.

1 Like

Hello!
My concern is along the same lines.
In JabRef, I used the menu options to customize entry types with new required and optional fields.
Subsequently, when I export the data in postgresql, using pgAdmin III these new fields do not appear in the tables. Unfortunately, I do not understand why?
I tried setting in preferences, the option file but without success
I would like you to help me in this way
Thank you in advance

Thanks for the reply. That does indeed look like the problem. Thanks for asking about a snapshot release on their github. For the time being I will use a PostgreSQL server on linux instead.

@Anita @chibber2018 Can you please try out the build from https://builds.jabref.org/postgreUpdate/. In this build, we use a more up-to-date postgre sql driver. Hopefully, this fixes the issues you experience.

(Please be aware that this is a current development version, thus please make a backup of your library first!)

Thanks Tobias. Unfortunately there is no PostgreSQL appearing in the dropdown menu in “Connect to shared database”. I can see only Oracle and MySQL.

From https://builds.jabref.org/postgreUpdate/ I tried with:
JabRef–postgreUpdate–latest.jar
JabRef-4.3-dev–snapshot–2018-05-14–postgreUpdate–0d19b2fe3.jar
and installed:
JabRef_windows-x64_4_3-dev–snapshot–2018-05-14–postgreUpdate–0d19b2fe3.exe

I’m using JRE 1.8.0_171.

I’m using JabRef_windows-x64_4_3_1 and until yesterday, was working with a .bib file - yesterday I tried to port everything to a PostgreSQL database.
Is it normal that everything takes forever? Connecting to the database when it’s empty happens in seconds. Now that I have 13000 references in it it already takes more than 30 min to just open the connection.
With this performance I have to go back to the file based version.
Any suggestions on why I see this change in performance with more references in my collection?

Hi,

I just recently converted the new Database Dialog to javafx and updated the driver accordingly. It now also supports SSL connection.
Please try out the latest master version https://builds.jabref.org/master/
It is advisable to create a backup before you try out the new version.

Please report back if this problem still occurs
Regards
Christoph

I know this is very old therad but I’m getting the same exception (like the first post) with jabref 4.3.1. I tried with different versions of postgres (11, 9.6, 9.4), all localhost, but no luck.

Java version: 1.8.0_221

I tried with the jabref 5 and it did work, but is there a fix for the jabref 4.3.1 since 5 is still in alpha?

edit: also tried java 1.8.0.171 - no success

Hi,

due to the lack of resources we are only able to support the latest jabref version (master).
Although the 5.0 is still alpha and contains some bugs (especially the released version), it should be generally very stable. I used it for a long time already and had no issues.

Regards

Thank you for the fast reply.

To resolve the issue with 4.3.1, I tried to modify this line in build.gradle based on Christoph second post

//compile ‘com.impossibl.pgjdbc-ng:pgjdbc-ng:0.7.1’
compile ‘com.impossibl.pgjdbc-ng:pgjdbc-ng:0.8.2’

and recompile the whole application, but the build fails at some point…
Can you tell me which gradle version and which java version should I install to be able to compile.

(I also tried to compile jabref 5 with jdk 11 and gradle 5.6.1 and it worked - that’s why I think this would help me)

Hi,
if you check out the 4.3.1 tag you should be able to run it by the ./gradlew run command.
Note that 4.x still requires Java 8 and javafx 8