无法为 Java 启用 emqx_extension_hook

问题描述

在开始启用 emqx_extension_hook 和启动 emqx 服务后,我面临以下错误

2021-03-21 10:05:12.456 [error] [ExHook Driver] CALL java 'SampleHandler':init([]),unkNown return: {'EXIT',{timeout,[{erlport,call,3,[{file,"erlport.erl"},{line,234}]},{emqx_extension_hook_driver,do_call,5,"emqx_extension_hook_driver.erl"},280}]},do_init,2,113}]},{emqx_extension_hook,enable,"emqx_extension_hook.erl"},49}]},{emqx_extension_hook_app,load_all_drivers,1,"emqx_extension_hook_app.erl"},66}]},start,38}]},{application_master,start_it_old,4,"application_master.erl"},277}]}]}}
2021-03-21 10:05:12.456 [error] [ExHook] Load driver java Failed: unkNown_return_format
2021-03-21 10:05:12.456 [error]   crasher:
    initial call: application_master:init/4
    pid: <0.1642.0>
    registered_name: []
    exception exit: {bad_return,{{emqx_extension_hook_app,[normal,[]]},{'EXIT',{{badmatch,{error,unkNown_return_format}},[{emqx_extension_hook_app,277}]}]}}}}
      in function  application_master:init/4 (application_master.erl,line 138)
    ancestors: [<0.1641.0>]
    message_queue_len: 1
    messages: [{'EXIT',<0.1643.0>,normal}]
    links: [<0.1641.0>,<0.1288.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 610
    stack_size: 27
    reductions: 228
  neighbours:

2021-03-21 10:05:12.460 [error] [Plugins] Load plugin emqx_extension_hook Failed,cannot start plugin emqx_extension_hook for {bad_return,277}]}]}}}}

你能帮忙吗? 我已将 .jar 文件(io.emqx.extension.jar 和 erlport.jar )和 .SampleHandler 放在 path = "/var/lib/emqx/extension/java/emqhook-java/bin/"

下面是我的配置文件(emqx_extension_hook.conf)

##====================================================================

##--------------------------------------------------------------------
## Driver confs

## Setup the supported drivers
##
## Value: python3 | java
exhook.drivers = java

## Search path for scripts/library
##
#exhook.drivers.python3.path = /var/lib/emqx/extension/
exhook.drivers.java.path = /var/lib/emqx/extension/java/emqhook-java/bin/
exhook.drivers.java.init_module = SampleHandler
## Call timeout
##
## Value: Duration
##exhook.drivers.python3.call_timeout = 5s

## Initial module name
##
##exhook.drivers.python3.init_module = main

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)