0

I am trying to run a python script in a NiFi ExecuteScript processor. This script uses the ldap3 library from: https://pypi.org/project/ldap3/. I am aware that the processor runs Jython, and that I am unable to use compiled code, .so files, etc. but I noted that the library claims to be:

A strictly RFC 4510 conforming LDAP V3 pure Python client library

I have defined the path to the folder containing the library in the processor's PROPERTIES tab, using

Script Engine    : python
Script File      : /mnt/path_to_my_scripts/run.py
Script Body      :
Module Directory : /mnt/path_to_my_libs

...where the ldap3 library folder is:

/mnt/path_to_my_libs/ldap3

When I start the processor I get the following error message:

16:17:32 GMT - server.my.domain:9091 - ERROR ExecuteScript[id=xxxx] Failed to process session due to org.apache.nifi.processor.exception.ProcessException: javax.lang.NoClassDefFoundError: org/scijava/jython/shaded/javax/xml/bind/DatatypeConverter in at line number 5: javax.script.ScriptException: javax.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/scijava/jython/shaded/javax/xml/bind/DatatypeConverter in at line number 5

Sure enough, line number 5 in the scipt is:

import ldap3

I have other scripts running successfully which do not use ldap3.

Charlie Joynt
  • 4,411
  • 1
  • 24
  • 46
  • I have just noticed this: http://bugs.jython.org/issue2663 – Charlie Joynt May 25 '18 at 16:32
  • Are you running Apache NiFi on Java 8 or Java 9? The current release of NiFi (1.6.0) is not compatible with Java 9. There is [work underway](https://issues.apache.org/jira/browse/NIFI-5174) to make future releases of NiFi run on Java 9. – Andy May 25 '18 at 19:04
  • I would hope a compatible version, but I'll have to check when I'm back in the office... – Charlie Joynt May 26 '18 at 17:29
  • Unless... you know of a better way to run LDAP queries from NiFi, although that might be better asked as a separate question. – Charlie Joynt May 26 '18 at 17:33
  • @Andy, this environment is **nifi-1.5.0-RC1** on **Java 1.8.0_121**. – Charlie Joynt May 29 '18 at 10:56

0 Answers0