ERROR: NullPointerException (HttpSmsClient:59 < MainModule:124 < <gener:-1 < ...)

Maurizio Panzica2 years ago

Hello Anton,

I have just moved my Traccar server to a Ubuntu 22.04 box.
Unfortunately the server would not start if I use the following block in my traccar.xml

    < entry key='notificator.types'>web,sms< /entry>
    < entry key='sms.enable'>true< /entry>
    < entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient< /entry>
    < entry key='sms.http.url'>https://api.telegram.org/bot***:***/sendMessage?< /entry>
    < entry key='sms.http.template'>chat_id={phone}&text={message}< /entry>

Here is the log with the error I get:

2022-08-05 01:06:11  INFO: Operating system name: Linux version: 5.15.0-43-generic architecture: amd64
2022-08-05 01:06:11  INFO: Java runtime name: OpenJDK 64-Bit Server VM vendor: ojdkbuild version: 11.0.13+8-LTS
2022-08-05 01:06:12  INFO: Memory limit heap: 938mb non-heap: 0mb
2022-08-05 01:06:12  INFO: Character encoding: UTF-8 charset: UTF-8
2022-08-05 01:06:12  INFO: Version: 5.2
2022-08-05 01:06:12  INFO: Starting server...
2022-08-05 01:06:12  INFO: Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system instability.
2022-08-05 01:06:12 ERROR: Main method error - NullPointerException (HttpSmsClient:59 < MainModule:124 < < gener:-1 < ...)

Any clues, please?
Thanks in advance.
Maurizio

Anton Tananaev2 years ago

Is there a reason you don't use telegram like this?

https://www.traccar.org/documentation/notifications/#telegram

Maurizio Panzica2 years ago

Yes, indeed.
That configuration only allows for one chat_id.
I share the server with a couple of friends so I need each user to get his own messages.
M.

Anton Tananaev2 years ago

Chat ID can be configured per user, as the documentation clearly states.

Maurizio Panzica2 years ago

Oh! I guess I missed the Attribute setting. DidnĀ“t know it was introduced and I just copied the old traccar.xml across.
I will try this setting immediately.
Thanks.