Bug 140015 - CONFIGURATION: JNI exception occurred with Zotero OpenOffice Integration
Summary: CONFIGURATION: JNI exception occurred with Zotero OpenOffice Integration
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.6.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-30 09:42 UTC by Diarmuid O'Briain
Modified: 2021-01-30 19:05 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Diarmuid O'Briain 2021-01-30 09:42:52 UTC
Description:
Version: 6.4.6.2
Build ID: 1:6.4.6-0ubuntu0.20.04.1
CPU threads: 12; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: en-GB (en_IE.UTF-8); UI-Language: en-GB

When I try to integrate Zotero with LibreOffice using the "Zotero_OpenOffice_Integration.oxt" file supplied by Zotero I receive:

-------------------------------------------------------------------------- 
(com.sun.star.uno.RuntimeException) {{ Message = "JNI exception occurred”,
Context = (com.sun.star.uno.Xinterface) @7F1bcc0017F8
(ImplementationName = "com.sun.star.comp.stoc. JavaVirtualMachine") } }
-------------------------------------------------------------------------- 

I raised a question on the Zotero forum and received the following answer:

"This is a problem with LibreOffice not being able to use your JRE and not specific to Zotero. You should try different versions of Java. Make sure LibreOffice sees them and they are selected when testing."

So I tried all of the available JRE's available to my Operating System 

System:
  Host: TP-P1-Gen-2 Kernel: 5.4.0-65-generic x86_64 bits: 64 compiler: gcc 
  v: 9.3.0 Desktop: Cinnamon 4.8.6 Distro: Linux Mint 20.1 Ulyssa 
  base: Ubuntu 20.04 focal 

In the case of OpenJDK I have tried all the available versions.

~$ apt search openjdk| grep -e '-jre '
i   openjdk-11-jre             - OpenJDK Java runtime, using Hotspot JIT                                                                                          
i   openjdk-13-jre             - OpenJDK Java runtime, using Hotspot JIT                                                                                          
i   openjdk-14-jre             - OpenJDK Java runtime, using Hotspot JIT                                                                                          
i   openjdk-8-jre              - OpenJDK Java runtime, using Hotspot JIT   

These equate to the following in LO.
Ubuntu          11.0.9.1
Private Build   13.0.4
Private Build   14.0.2
Private Build   1.8.0_275

Running the "Zotero_OpenOffice_Integration.oxt" file in each case results in me initially getting the information box:

-----------------------------------------------------------------------------------
You are about to install version 5.0.23 of the extension ‘Zotero
LibreOffice Integration’.
That version is already installed.
Click 'OK' to replace the installed extension.
Click ‘Cancel’ to stop the installation.
-----------------------------------------------------------------------------------

and when I do click connect I receive the following message:

-------------------------------------------------------------------------------------------------------
(com.sun.star.uno.RuntimeException) {{ Message = "JNI exception occurred”,
Context = (com.sun.star.uno.Xinterface) @7F1bcc0017F8
(ImplementationName = "com.sun.star.comp.stoc. JavaVirtualMachine") } }
-------------------------------------------------------------------------------------------------------

In the case of Oracle JREs, they all appear to be linked to "oracle-java15-jre" and this fails in the same way as the OpenJDK versions. See my attempt to install "oracle-java12-jre". There appears to have been some sort of license change and Oracle don't readily give access to earlier versions. 

~$ sudo apt install oracle-java12-jre
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'oracle-java15-installer' instead of 'oracle-java12-jre'
oracle-java15-installer is already the newest version (15.0.2-1~linuxuprising0).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-62 linux-headers-5.4.0-62-generic
  linux-image-5.4.0-62-generic linux-modules-5.4.0-62-generic
  linux-modules-extra-5.4.0-62-generic python3-dbus.mainloop.pyqt5
  python3-notify2
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

NB: I have tried with both Open GL enabled and Open GL disabled, it makes no difference, the outcome is the same.

Steps to Reproduce:
1. Run "Zotero_OpenOffice_Integration.oxt" (from Zotero application)
2. Click OK to info box "You are about to install version 5.0.23 of the extension ‘Zotero"
3. "JNI exception occurred" error will appear.

Actual Results:
(com.sun.star.uno.RuntimeException) {{ Message = "JNI exception occurred”,
Context = (com.sun.star.uno.Xinterface) @7F1bcc0017F8
(ImplementationName = "com.sun.star.comp.stoc. JavaVirtualMachine") } }

Expected Results:
Zotero icons appear in Writer. 


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Version: 6.4.6.2
Build ID: 1:6.4.6-0ubuntu0.20.04.1
CPU threads: 12; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: en-GB (en_IE.UTF-8); UI-Language: en-GB
Calc: CL
Comment 1 [REDACTED] 2021-01-30 14:08:44 UTC
no repro

Version: 7.0.4.2, Build ID: dcf040e67528d9187c66b2379df5ea4407429775
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE, Calc: threaded

(Ubuntu 20.04 using TDF packages from https://www.libreoffice.org/download/download/)

Please check https://ask.libreoffice.org/en/questions/scope:all/sort:age-desc/page:1/ for many errors related to initial installs of LibreOffice 6.4.6.2 from Ubuntu repositories and Ubuntu 20.04
Comment 2 [REDACTED] 2021-01-30 14:38:04 UTC
no repro

Version: 6.4.6.2, Build-ID: 1:6.4.6-0ubuntu0.20.04.1
CPU-Threads: 4; BS: Linux 5.4; UI-Render: Standard; VCL: gtk3; 
Gebietsschema: de-DE (de_DE.UTF-8); UI-Sprache: de-DE, Calc: threaded

after purging all Ubuntu libreoffice packages, apt autoremove and re-installing from Ubuntu base repositories (no PPA).
Comment 3 Diarmuid O'Briain 2021-01-30 19:05:47 UTC
I went for the nuclear option and I have reinstalled Linux Mint 20.1 Ulyssa from scratch as against the upgrade from Mint 20.0 Ulyana I had previously carried out. Zotero connects fine with LibreOffice now and the integration was successful.

[code]$ java --version
openjdk 11.0.9.1 2020-11-04

Version: 6.4.6.2
Build ID: 1:6.4.6-0ubuntu0.20.04.1
CPU threads: 12; OS: Linux 5.4; UI render: default; VCL: gtk3;
Locale: en-IE (en_IE.UTF-8); UI-Language: en-US
Calc: CL[/code]

Something happened in the upgrade process from Linux Mint 20.0 Ulyana that was causing the problem, presumably with Java?