Using openhab 3.1 with jython helper libraries.
Normal actions like Voice.say work fine but WebPushNotificationAction.sendHABotNotification produces the following runtime exception:
java.lang.RuntimeException
obj.localizedMessage = u'java.lang.ClassNotFoundException'
obj.stackTrace = array(java.lang.StackTraceElement, [javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50), javax.ws.rs.client.ClientBuilder.newClient(ClientBuilder.java:55), org.openhab.ui.habot.notification.internal.webpush.PushService.send(PushService.java:156), org.openhab.ui.habot.notification.internal.NotificationService.sendNotification(NotificationService.java:128), org.openhab.ui.habot.notification.internal.NotificationService.broadcastNotification(NotificationService.java:110), org.openhab.ui.habot.notification.WebPushNotificationAction.sendHABotNotificationExt(WebPushNotificationAction.java:101), org.openhab.ui.habot.notification.WebPushNotificationAction.sendHABotNotification(WebPushNotificationAction.java:46), java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method), java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62), java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.base/java.lang.reflect.Method.invoke(Method.java:566), org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190), org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:208), org.python.core.PyObject.__call__(PyObject.java:461), org.python.core.PyObject.__call__(PyObject.java:465), org.python.pycode._pyx1035.pushReport$11(/etc/openhab/automation/jsr223/python/personal/00_routines_statuschecks.py:117), org.python.pycode._pyx1035.call_function(/etc/openhab/automation/jsr223/python/personal/00_routines_statuschecks.py), org.python.core.PyTableCode.call(PyTableCode.java:173), org.python.core.PyBaseCode.call(PyBaseCode.java:150), org.python.core.PyFunction.__call__(PyFunction.java:426), org.python.core.PyMethod.__call__(PyMethod.java:141), org.python.pycode._pyx1035.handleInvokeLeave$13(/etc/openhab/automation/jsr223/python/personal/00_routines_statuschecks.py:142), org.python.pycode._pyx1035.call_function(/etc/openhab/automation/jsr223/python/personal/00_routines_statuschecks.py), org.python.core.PyTableCode.call(PyTableCode.java:173), org.python.core.PyBaseCode.call(PyBaseCode.java:150), org.python.core.PyFunction.__call__(PyFunction.java:426), personal.composer$py._wrapper$10(/etc/openhab/automation/lib/python/personal/composer.py:77), personal.composer$py.call_function(/etc/openhab/automation/lib/python/personal/composer.py), org.python.core.PyTableCode.call(PyTableCode.java:173), org.python.core.PyBaseCode.call(PyBaseCode.java:150), org.python.core.PyFunction.__call__(PyFunction.java:426), org.python.core.PyMethod.__call__(PyMethod.java:141), personal.composer$py.execute$3(/etc/openhab/automation/lib/python/personal/composer.py:28), personal.composer$py.call_function(/etc/openhab/automation/lib/python/personal/composer.py), org.python.core.PyTableCode.call(PyTableCode.java:173), org.python.core.PyBaseCode.call(PyBaseCode.java:306), org.python.core.PyBaseCode.call(PyBaseCode.java:197), org.python.core.PyFunction.__call__(PyFunction.java:485), org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237), org.python.core.PyMethod.__call__(PyMethod.java:228), org.python.core.PyMethod.__call__(PyMethod.java:218), org.python.core.PyMethod.__call__(PyMethod.java:213), org.python.core.PyObject._jcallexc(PyObject.java:3565), org.python.core.PyObject._jcall(PyObject.java:3598), org.python.proxies.personal.composer$__RelayRule$2015.execute(Unknown Source), org.openhab.core.automation.module.script.rulesupport.shared.simple.SimpleRuleActionHandlerDelegate.execute(SimpleRuleActionHandlerDelegate.java:34), org.openhab.core.automation.module.script.rulesupport.internal.delegates.SimpleActionHandlerDelegate.execute(SimpleActionHandlerDelegate.java:59), org.openhab.core.automation.internal.RuleEngineImpl.executeActions(RuleEngineImpl.java:1183), org.openhab.core.automation.internal.RuleEngineImpl.runRule(RuleEngineImpl.java:991), org.openhab.core.automation.internal.TriggerHandlerCallbackImpl$TriggerData.run(TriggerHandlerCallbackImpl.java:90), java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515), java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264), java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304), java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128), java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628), java.base/java.lang.Thread.run(Thread.java:829)])
A rule with the classic rule engine that just states:
rule "habot.notify"
when
Item TestSwitch1 changed to ON
then
sendHABotNotification("foo")
end
produces something quite similar:
2021-07-28 09:06:04.327 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘test-1’ failed: java.lang.ClassNotFoundException in test
On the other hand, a rule clicked together in UI works just fine
code of the rule:
triggers: []
conditions: []
actions:
- inputs: {}
id: "1"
configuration:
body: Ring Ring Ring
type: habot.WebPushNotificationAction
Please help