You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

NiFi ExecuteScript处理器无法加载ldap3 Python模块求助

NiFi ExecuteScript (Jython) 导入ldap3库时遭遇NoClassDefFoundError

我在NiFi的ExecuteScript处理器里运行Python脚本,想用到ldap3这个纯Python实现的LDAP V3客户端库。我知道ExecuteScript用的是Jython,没法用编译后的代码或者.so文件,而这个库明确说是纯Python实现的,所以觉得应该没问题。

我已经在处理器的PROPERTIES标签页做了这些配置:

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

ldap3库的文件夹就放在/mnt/path_to_my_libs/ldap3下面。但启动处理器的时候却报错了,错误信息如下:

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

我的脚本第5行就是import ldap3,而且其他没有用到ldap3的脚本在这个处理器里都能正常运行。有没有人遇到过类似的问题?该怎么解决这个依赖缺失的问题呢?

内容的提问来源于stack exchange,提问作者MisterSeajay

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 06:47:32