Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.
Event Handler - Configuration Import - 3.2.2
-
Good Afternoon,
I was trying to upload an edit to a couple of event handlers but was thrown a "java.lang.NullPointerException" error.
I copied this directly from the output of the export function.
{ "eventHandlers":[ { "eventType":{ "sourceType":"DATA_POINT", "dataPointXID":"SiteName_SYS_SITE_SHUTDOWN", "detectorXID":"SiteName_SITE_SHUTDOWN" }, "xid":"SiteName_SITE_SHUTDOWN_Email", "handlerType":"EMAIL", "activeRecipients":[ { "recipientType":"MAILING_LIST", "mailingList":"Cell_ML" } ], "sendEscalation":false, "sendInactive":false, "includeSystemInformation":false, "includePointValueCount":1, "includeLogfile":false, "customTemplate":"<#include \"\/text\/include\/siteNameShutdown.ftl\">", "additionalContext":[ { "contextKey":"site", "dataPointXid":"SiteName_SYS_SITE_SHUTDOWN" } ], "alias":"", "disabled":false } ] }
I changed "sendInactive":false to "sendInactive":true and cliked import.
The mango log file shows:
ERROR 2018-03-20T16:40:41,687 (com.serotonin.m2m2.web.dwr.emport.ImportTask.runImpl:195) - null java.lang.NullPointerException: null at com.serotonin.json.type.JsonObject.getBoolean(JsonObject.java:131) ~[mango-3.2.2.jar:?] at com.serotonin.m2m2.vo.event.EmailEventHandlerVO.jsonRead(EmailEventHandlerVO.java:377) ~[mango-3.2.2.jar:?] at com.serotonin.json.convert.JsonPropertyConverter.jsonRead(JsonPropertyConverter.java:136) ~[mango-3.2.2.jar:?] at com.serotonin.json.JsonReader.readInto(JsonReader.java:290) ~[mango-3.2.2.jar:?] at com.serotonin.json.JsonReader.readInto(JsonReader.java:255) ~[mango-3.2.2.jar:?] at com.serotonin.m2m2.web.dwr.emport.importers.EventHandlerImporter.importImpl(EventHandlerImporter.java:48) ~[mango-3.2.2.jar:?] at com.serotonin.m2m2.web.dwr.emport.Importer.doImport(Importer.java:38) ~[mango-3.2.2.jar:?] at com.serotonin.m2m2.web.dwr.emport.ImportTask.runImpl(ImportTask.java:181) [mango-3.2.2.jar:?] at com.serotonin.m2m2.util.timeout.ProgressiveTask.run(ProgressiveTask.java:61) [mango-3.2.2.jar:?] at com.serotonin.timer.Task.runTask(Task.java:179) [classes/:?] at com.serotonin.timer.TaskWrapper.run(TaskWrapper.java:23) [classes/:?] at com.serotonin.timer.OrderedThreadPoolExecutor$OrderedTaskCollection.run(OrderedThreadPoolExecutor.java:310) [classes/:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_144] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_144] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]
I did use the import function to originally add these event handlers so it is odd to me that it wouldn't accept the update to the handler.
Am I missing something obvious?
Thanks!
-
Hi Xof1986,
It looks like there are a few NPEs lingering in the EmailEventHandlerVO import surrounding changing whether or not to send escalations and send inactive. In 3.2.2 this is probably due to a missing "inactiveOverride" boolean property (and if true, you would need the "inactiveRecipients" list not to be null. I will fix these up to not cause NPEs. There are similar NPEs should you modify "sendInactive"
Thanks for bringing this to our attention!
-