parseLanMessage error

groovy.lang.MissingMethodException: No signature of method: app1549849008357535160588.parseLanMessage() is applicable for argument types: (com.hubitat.hub.domain.Event) values: [com.hubitat.hub.domain.Event@34483390] on line 124 (lanResponseHandler)

Code is here: Honewell_Security.groovy · GitHub

The app seems to work as designed, but this error happens often so I'd like to get it resolved. Any way to capture what is generating the error?

The reference to map is in line 136 and the jsonMap in line 139. Then processEvent uses the jsonMap.

1 Like

I commented out the 1st one as it wasn’t required, left the second one and got this.

groovy.lang.MissingMethodException: No signature of method: app15502865071881070225053.parseLanMessage() is applicable for argument types: (com.hubitat.hub.domain.Event) values: [com.hubitat.hub.domain.Event@1bad98be] on line 124 (lanResponseHandler)

The next line is calling the same function hence the same result I guess.

I’ll throw a log.debug for ${evt} right before that and see what I can get from it.

app:482019-02-16 10:17:16.094 pm debugbefore parseLanMessage: mac:B827EBA45710, ip:c0a8014e, port:8d58, headers:Tk9USUZZIC9ub3RpZnkgSFRUUC8xLjENCkNvbm5lY3Rpb246IGNsb3NlDQpIb3N0OiAxOTIuMTY4LjEuMTY6Mzk1MDENCnN0bnAtcGx1Z2luOiBlbnZpc2FsaW5rDQpDb250ZW50LUxlbmd0aDogOTcNCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbg0K, body:eyJ0eXBlIjoicGFydGl0aW9uIiwicGFydGl0aW9uIjoxLCJzdGF0ZSI6ImFybWVkc3RheSIsImFscGhhIjoiQVJNRUQgKioqU1RBWSoqKk1heSBFeGl0IE5vdyAgNTgifQ==
app:482019-02-16 10:17:15.092 pm debugbefore parseLanMessage: mac:B827EBA45710, ip:c0a8014e, port:8d56, headers:Tk9USUZZIC9ub3RpZnkgSFRUUC8xLjENCkNvbm5lY3Rpb246IGNsb3NlDQpIb3N0OiAxOTIuMTY4LjEuMTY6Mzk1MDENCnN0bnAtcGx1Z2luOiBlbnZpc2FsaW5rDQpDb250ZW50LUxlbmd0aDogOTcNCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbg0K, body:eyJ0eXBlIjoicGFydGl0aW9uIiwicGFydGl0aW9uIjoxLCJzdGF0ZSI6ImFybWVkc3RheSIsImFscGhhIjoiQVJNRUQgKioqU1RBWSoqKk1heSBFeGl0IE5vdyAgNTkifQ==
app:482019-02-16 10:17:14.619 pm errorgroovy.lang.MissingMethodException: No signature of method: app15503729094011703511893.parseLanMessage() is applicable for argument types: (com.hubitat.hub.domain.Event) values: [com.hubitat.hub.domain.Event@5dc5c358] on line 125 (lanResponseHandler)
app:482019-02-16 10:17:14.580 pm debugbefore parseLanMessage: com.hubitat.hub.domain.Event@5dc5c358`

Instead of just parseLanMessage (evt) try parseLanMessage (evt.description)

[app:48](http://192.168.1.16/logs#app48)2019-02-17 03:52:38.031 pm [error](http://192.168.1.16/installedapp/configure/48)groovy.lang.MissingPropertyException: No such property: description for class: java.lang.String on line 124 (lanResponseHandler)

[app:48](http://192.168.1.16/logs#app48)2019-02-17 03:52:38.022 pm [error](http://192.168.1.16/installedapp/configure/48)groovy.lang.MissingPropertyException: No such property: description for class: java.lang.String on line 124 (lanResponseHandler)

[app:48](http://192.168.1.16/logs#app48)2019-02-17 03:52:35.269 pm [error](http://192.168.1.16/installedapp/configure/48)groovy.lang.MissingPropertyException: No such property: description for class: java.lang.String on line 124 (lanResponseHandler)

[app:48](http://192.168.1.16/logs#app48)2019-02-17 03:52:35.261 pm [error](http://192.168.1.16/installedapp/configure/48)groovy.lang.MissingPropertyException: No such property: description for class: java.lang.String on line 124 (lanResponseHandler)

[app:48](http://192.168.1.16/logs#app48)2019-02-17 03:52:26.317 pm [error](http://192.168.1.16/installedapp/configure/48)groovy.lang.MissingPropertyException: No such property: description for class: java.lang.String on line 124 (lanResponseHandler)

I think I have a fix. Let me watch it for a couple of days. I think I need a try {} catch around parseLanMessage.

Brian

BTW, this was the fix. The events that couldn't be parsed were null/null events, so this keeps the error from throwing.

def lanResponseHandler(fromChildDev) {
try {
	def parsedEvent = parseLanMessage(fromChildDev).json
	def description = parsedEvent?.description
	def map = parseLanMessage(fromChildDev)
	if (map.headers.'stnp-plugin' != settings.pluginType) {
  		return
	}
	processEvent(parsedEvent)
} catch(MissingMethodException) {
	// these are events with description: null and data: null, so we'll just pass.
	pass
}

}

1 Like