Cannot send Telegram messages; NullPointerException

Trying to use the Telegram binding to send messages on actions. I configured the bot according to the docs. When I send the bot a chat via Telegram app, I do see the update in PaperUI, so I know it’s working in receive mode at least.

When trying to send messages, however, I’m getting this error in the openhab.log:

    2020-09-08 16:06:18.373 [ERROR] [dule.handler.AnnotationActionHandler] - Could not call method 'public boolean,java.lang.String,java.lang.Object[])' from module type 'telegram.sendTelegram'.
java.lang.reflect.InvocationTargetException: null
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_252]
	at sun.reflect.NativeMethodAccessorImpl.invoke( ~[?:1.8.0_252]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke( ~[?:1.8.0_252]
	at java.lang.reflect.Method.invoke( ~[?:1.8.0_252]
	at org.openhab.core.automation.internal.module.handler.AnnotationActionHandler.execute( [bundleFile:?]
	at org.openhab.core.automation.internal.RuleEngineImpl.executeActions( [bundleFile:?]
	at org.openhab.core.automation.internal.RuleEngineImpl.runRule( [bundleFile:?]
	at org.openhab.core.automation.internal.TriggerHandlerCallbackImpl$ [bundleFile:?]
	at java.util.concurrent.Executors$ [?:1.8.0_252]
	at [?:1.8.0_252]
	at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:1.8.0_252]
	at java.util.concurrent.ThreadPoolExecutor$ [?:1.8.0_252]
	at [?:1.8.0_252]
Caused by: java.lang.NullPointerException

Can you show us how you are trying to send the messages?

I simply created a rule that says ‘when the state of the door sensor changes, send Telegram message’

Where can I find more logs? The main openhab.log doesn’t seem to show much in regards to troubleshooting this. When I click the ‘Play’ icon to test the rule, nothing happens. No message, no errors in the log.

What does your telegram message look like?

No messages are received. That’s what led me to get into the logs, only to discover the nullpointer error.

This may be an issue with the new Rules UI. I was able to set up a test rule using the text files (ie: /opt/openhab/conf/rules/lights.rules) and that works as expected.

What is the message configuration you are trying to send look like?

 sendTelegram("bot1", "item Foo changed")

I don’t see where to add messages in the UI.

Not sure as I do not use the new rules engine and everything except Things are in files but if it’s working in files then you can open an issue on Github to have the feature added/fixed.

It might be the generiv action invoke bug, triggered when a binding gets updated. In that case stop openHAB, clean cache and start again.