PostgreSQL connection - JabRef 4.0, 4.1, 4.2


(chibber2018) #1

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]

(Christoph) #2

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.


(Ann AYO) #3

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


(chibber2018) #4

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.


(Tobias Diez) #5

@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!)


(chibber2018) #6

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.