Jabref: Linking to Libre/OpenOffice fails because of classloader exception

Created on 30 Aug 2019  ·  13Comments  ·  Source: JabRef/jabref

JabRef version 5.x on Ubuntu 18.04 LTS

Steps to reproduce the behavior:

  1. Manual connect to Libreoffice (Auto connect generates same error)
  2. Specify directory for .jar class files: /usr/lib/libreoffice/program/classes (have double-checked that they are actually there)
  3. Click OK
  4. Error: "Could not connect to running OpenOffice/LibreOffice
    (Not all) required OpenOffice jars were found inside the installation path. Searched for [unoil.jar, jurt.jar, juh.jar., ridl.jar] in /opt/openoffice.org3"

Stacktrace:

java.io.IOException: (Not all) required Open Office Jars were found inside installation path. Searched for [unoil.jar, jurt.jar, juh.jar, ridl.jar] in /opt/openoffice.org3
at org.jabref.gui.openoffice.OpenOfficePanel.loadOpenOfficeJars(OpenOfficePanel.java:449)
at org.jabref.gui.openoffice.OpenOfficePanel$2.call(OpenOfficePanel.java:389)
at org.jabref.gui.openoffice.OpenOfficePanel$2.call(OpenOfficePanel.java:384)
at javafx.concurrent.Task$TaskCallable.call(Task.java:1425)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

openofficlibreoffice waiting-for-customer-feedback bug 🐛

Most helpful comment

It works. I could click on connect and it connected. I could further insert a citation. Thank you very much for the fix :)

All 13 comments

Try to reset your preferences. There seems to be still the wrong old path stored in the preferences.

Thank you very much for your help. I've followed that. Now it generates the following error (which seems to happen in both automatic and manual):

"Autodetection failed"

java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
at org.jabref.gui.openoffice.OpenOfficePanel.addURL(OpenOfficePanel.java:141)
at org.jabref.gui.openoffice.OpenOfficePanel.loadOpenOfficeJars(OpenOfficePanel.java:456)
at org.jabref.gui.openoffice.OpenOfficePanel$2.call(OpenOfficePanel.java:389)
at org.jabref.gui.openoffice.OpenOfficePanel$2.call(OpenOfficePanel.java:384)
at javafx.concurrent.Task$TaskCallable.call(Task.java:1425)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

Ah thanks for the report.
I think this is related to the new ClassLoader stuff in java 11.
See https://blog.codefx.org/java/java-11-migration-guide/#Casting-To-URL-Class-Loader

I'm also effected by this. The link sounds like its a lot of work to fix. Should one role back to older jabref version for the moment if this functionality is required?

Yes. If you use thisffunction regularly, you might want to use an older version JabRef for the moment.
A development version before the Java 11 change should also work.

We are of course trying to fix this problem, but it's indeed a bit more complicated since it involves loading the Libre office jars at runtime. And that stuff has changed with Java 9/11....🤔

@rsdc2 @deisi Good news, I found a solution to fix this:
Could you please try this version here and report back if it works?
https://builds.jabref.org/fixOpenOffice/

(it now uses sockets instead of named pipes)

Thanks so much for doing that! I'll check it tomorrow when I have access to my computer and let you know.

It works. I could click on connect and it connected. I could further insert a citation. Thank you very much for the fix :)

This should be fixed in the latest master now.

We would like to ask you to use a development build from https://builds.jabref.org/master and report back if it works for you. Please remember to make a backup of your library before trying-out this version.

Thanks again for your work on this. I just tried running the latest master. When I try to launch the new jar file from the terminal, I get the following message:

Error: Could not find or load main class org.jabref.org.jabref.JabRefLauncher
Caused by: java.lang.ClassNotFoundException: org.jabref.org.jabref.JabRefLauncher

I tested the earlier version, and that still launches.

Running directly from the jar is no longer possible.
please use either the Linux tar.gz archive or the windows installer. It includes all the necessary dependencies and a start script

Ok thanks very much. I'll do that.

On Mon, 16 Sep 2019, 18:52 Christoph, notifications@github.com wrote:

Running directly from the jar is no longer possible.
please use either the Linux tar.gz archive or the windows installer. It
includes all the necessary dependencies and a start script


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/JabRef/jabref/issues/5261?email_source=notifications&email_token=ANBLFOG2GQHHO2TETSAYEVLQJ7BWNA5CNFSM4ISKJNY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6Z643I#issuecomment-531885677,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANBLFOEQCDOW55TMZQWW2VTQJ7BWNANCNFSM4ISKJNYQ
.

It all works - thank you very much for your help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thorstenwagner picture thorstenwagner  ·  4Comments

lenhard picture lenhard  ·  4Comments

diabl0w picture diabl0w  ·  3Comments

Siedlerchr picture Siedlerchr  ·  3Comments

LinusDietz picture LinusDietz  ·  3Comments