bacnet4j-wrapper icon indicating copy to clipboard operation
bacnet4j-wrapper copied to clipboard

Request for detailed exception root cause message for BacNetClientException trace

Open saransh14 opened this issue 1 year ago • 4 comments

I'm using YABE simulator, and for Heater.status, I'm sometimes getting the BacNetClientException, but while looking at the exception payload I'm unable to identify the root cause of the failure for fetching the present value for the defined bacnet object. Is there any way by which I can identify the root cause of the problem for the failure for fetching the present value.

I'm attaching the snapshot of the captures stack trace for BacNetClientException but I'm unable to understand the reason of failure. image

saransh14 avatar Mar 18 '24 08:03 saransh14

I've had a look on client code (BacNetClientBase) and all places there propagate exceptions. Even the Could not get property value message comes from such place: https://github.com/Code-House/bacnet4j-wrapper/blob/bacnet4j-wrapper-1.3.0-beta1/api/src/main/java/org/code_house/bacnet4j/wrapper/api/BacNetClientBase.java#L186

It is likely that you get timeout errors, have a look on BacNetClientException#getCause.

splatch avatar Mar 20 '24 23:03 splatch

Still unable to track the root cause of the problem by looking onto the BacNetClientException#getCause I tracked down the stack trace and found the following:

image

saransh14 avatar Mar 23 '24 09:03 saransh14

Your cause is at the end - the ArrayIndexOutOfBoundsException. For some reason bacnet4j is loosing its mind reading BinaryPV value. Can you reproduce it in all cases?

splatch avatar Mar 23 '24 11:03 splatch

I've observed this issue intermittently while reading value from YABE Simluator, for State.Heater object binaryValue:0 Can we look into these scenarios, and add the appropriate messages under DetailMessage so that it would enable user to easily identify the issue while looking at exception, and would also help in logging details for the exception caused.

saransh14 avatar Mar 23 '24 13:03 saransh14