"Can't find org.jpype.jar support library" error after update to orekit_jpype 13.1.2.1 / jpype 1.6.0

Hello,

We are seeing a regression on our CI pipelines since orekit_jpype and jpype1received their latest update.

What used to work

  • orekit_jpype 13.0.2.2
  • jpype1 1.5.0

What doesn’t work :

  • orekit_jpype 13.1.2.1
  • jpype1 1.6.0

Failure materializes as follows :

../../customBasilisk/utilities/orekitHelper/__init__.py:169: in startOrekitVm
    orekit_jpype.initVM()
/opt/conda/lib/python3.11/site-packages/orekit_jpype/orekit_jpype.py:53: in initVM
    jpype.startJVM(*args, convertStrings=True, jvmpath=jvmpath)
/opt/conda/lib/python3.11/site-packages/jpype/_core.py:357: in startJVM
    _jpype.startup(jvmpath, tuple(jvm_args + extra_jvm_args),
E   RuntimeError: Can't find org.jpype.jar support library

A short term solution on our end consists in pinning down the orekit_jpype and jpype1 versions to their former values, but I am curious whether anyone else ran into the same problem and found a way to fix it. Thanks !

Hi,

I’ve had problems with the last jpype version.
Have you tried downgrading it to 1.5.2?

Cheers,
Romain

downgrading to 1.5.2 indeed works fine alongside the latest orekit_jpype, thanks !

Salut Benjamin,

You can also try setting the JAVA_HOME variable before starting the VM:

    import orekit_jpype
    import os
    import jdk4py
    os.environ["JAVA_HOME"] = str(jdk4py.JAVA_HOME)
    orekit_jpype.initVM()

However it seems that the latest version of jpype has significant performance issues. I’m not sure exactly what causes it but I’m seeing a propagation time about 3x slower with jpype now compared to JCC, so I would recommend staying with the previous version as @Serrof suggested.

Hi,

Maybe you are using JDK8? Its support was removed in jpype 1.6.0, it throws this RuntimeError when using JDK8 with jpype 1.6.0: https://github.com/jpype-project/jpype/issues/1312

As for the performance issues @cmasson, this sounds scary… If you have a minimum working example with profiler, you could maybe open an issue on the jpype github, but I’ll also try soon if I find the time.

I think I’ve narrowed down the performance problem to the release 13.0.2.0 of orekit-jpype. It doesn’t seem to be an issue with the jpype version though:

  • 13.0.1.1 seems to work with jpype versions 1.5.0 and 1.6.0
  • 13.0.2.0 does not work with the same performance as JCC even with jpype 1.5.0
  • orekit+jcc has no change in performance between 13.0.1 and 13.1

It’s a bit difficult to isolate the changes between orekit, orekit_jpype, java and jdk4py though.

Here’s what I’m doing: we have our own build of orekit+jcc to make it installable via pip. I’ve built a poetry environment where both wrappers are installed at the same time, and wrote a quick numerical propagation script. I’m measuring the time spent in the propagate method.
The propagation runs twice and I’m timing both runs, because the caching by orekit speeds up the second time.

Usually the performance between JCC and jpype is similar (+/- 10% one way or the other), but in the failing cases I see big differences like 7s for JCC vs 18s for jpype.

I’ll try to clean up the script and make it as minimal as possible tomorrow, hopefully someone else can reproduce the issue.

1 Like

Hi Clement,

Thanks for this. When you do have a runnable script, could you create a dedicated thread for it please?
About performance itself, just to be sure, in your test do you use only native Orekit stuff or do you have custom implementations of Interface?

Cheers,
Romain.

I’ve opened a dedicated thread here: Performance issue with jpype . And yes there’s nothing special about the script, it’s a basic numerical propagation.