I'm writing an ingest processor that has a JSON string as input. I'm using Jackson library to read that string but it seams that there are some limitation on the usage of the java reflection API. I'm getting the following error :
com.fasterxml.jackson.databind.JsonMappingException: Can not access public com.lingway.xtirp.domain.RootLayerDTO() (from class com.lingway.xtirp.domain.RootLayerDTO; failed to set access: access denied ("java.lang.reflect.ReflectPermission" "suppressAccessChecks")
As you can see the Reflection API tells me that the public empty constructor cannot be accessed due to the ReflectPermission restriction "suppressAccessChecks".
Does Elasticsearch sets those restriction ?
Is there an alternative for JSON parsing in ingest processor ?
Scripts in elasticsearch run in a sandbox with limited privileges. In ES 5.x, you could try using groovy's builtin json parsing (I have not tried this, and it may result in more reflective failures, but it may be worth a try). That assumes you specify the script lang as groovy, which will be removed for 6.0. In 6.0, we are working on adding context specific (eg just for ingest scripts) whitelisting which would allow extra methods like this.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.