question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RuntimePermission error when trying to load the H3 Java library

See original GitHub issue

Hi guys,

As I read on the general H3 roadmap that some help was welcome to integrate H3 with Elasticsearch, I decided to create an Elasticsearch ingest processor that provides support for creating H3 indexes on the fly given a geo location point.

The new processor is packaged as an Elasticsearch plugin and deployed on Elastic Cloud. The plugin instantiates the library using:

    H3Core h3 = H3Core.newInstance();

However, when I make use of the ingest-h3 processor, I’m getting the following error:

      "error" : {
        "root_cause" : [
          {
            "type" : "access_control_exception",
            "reason" : """access denied ("java.lang.RuntimePermission" "loadLibrary./tmp/elasticsearch-4590080898583617881/libh3-java12293578950618569557.so")"""
          }
        ],
        "type" : "access_control_exception",
        "reason" : """access denied ("java.lang.RuntimePermission" "loadLibrary./tmp/elasticsearch-4590080898583617881/libh3-java12293578950618569557.so")"""
      }

Trying to use H3Core.newSystemInstance() yields a similar error, which makes more sense since the h3-java native library is not installed system-wide:

      "error" : {
        "root_cause" : [
          {
            "type" : "access_control_exception",
            "reason" : """access denied ("java.lang.RuntimePermission" "loadLibrary.h3-java")"""
          }
        ],
        "type" : "access_control_exception",
        "reason" : """access denied ("java.lang.RuntimePermission" "loadLibrary.h3-java")"""
      }

It’s also worth noting that in the plugin-security.policy file I have added the following permission:

 permission java.lang.RuntimePermission "loadLibrary.*";

I’m a bit out of solutions and not sure how I can have the H3 native library loaded. If anyone can help shed some light on this, it’d be much appreciated. Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
consulthyscommented, Oct 24, 2019

Indeed I tried the same thing and it worked out. Thanks for your help, much appreciated!

0reactions
consulthyscommented, Oct 24, 2019

For those who’re interested the H3 ingest processor repo is here: https://github.com/consulthys/elasticsearch-ingest-h3

Still a lot of work to do, but the building blocks are there!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android h3: A Hexagonal Hierarchical Geospatial Indexing ...
UnsatisfiedLinkError : This can be encountered when the corresponding native library is not copied/detected in the project. Following NickRadu's ...
Read more >
jdk-updates/jdk9u/jdk: a22f016c6555
src/java.base/share/classes/java/lang/RuntimePermission.java, 8 ... Error thrown when something goes wrong while loading a service provider.
Read more >
How to add needed libraries into the applet's JAR file from the ...
Inside the JAR's applet file there are any libraries [ex: axis.jar,. ... AccessControlException: access denied (java.lang.RuntimePermission ...
Read more >
Diff - platform/libcore - Google Git
The optimization happens implicitly in the VM the first time - * someone tries to load a class from an unoptimized dex file....
Read more >
ClassLoader.java - Android Code Search
Error.java ... certificates than this class, or if an attempt is made ... method to locate the native libraries that belong to classes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found