RuntimePermission error when trying to load the H3 Java library
See original GitHub issueHi 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:
- Created 4 years ago
- Comments:5
Indeed I tried the same thing and it worked out. Thanks for your help, much appreciated!
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!