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

Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

Null Pointer Exception in SequenceOf.write

  • Matthew,

    I've been doing a bit of testing and I hit a NPE in

    Here's a little background:

    I give my user the ability to add/remove sensors (analog or binary inputs) they want exposed through BACnet. So let's say I create 10 bacnet objects I add to my local device. Everything is fine. I hit my slave server with a BACnet browser and I can see everything as expected. If I delete any number of bacnet objects using removeObject on the local device and then run the scan again from my BACnet browser, I get the exception.

    Here is the full stack trace:

    	at com.serotonin.bacnet4j.type.constructed.SequenceOf.write(
    	at com.serotonin.bacnet4j.type.constructed.BaseType.write(
    	at com.serotonin.bacnet4j.type.Encodable.writeEncodable(
    	at com.serotonin.bacnet4j.type.constructed.ReadAccessResult$Result.write(
    	at com.serotonin.bacnet4j.type.constructed.SequenceOf.write(
    	at com.serotonin.bacnet4j.type.constructed.BaseType.write(
    	at com.serotonin.bacnet4j.type.Encodable.write(
    	at com.serotonin.bacnet4j.type.Encodable.writeOptional(
    	at com.serotonin.bacnet4j.type.constructed.ReadAccessResult.write(
    	at com.serotonin.bacnet4j.type.constructed.SequenceOf.write(
    	at com.serotonin.bacnet4j.type.Encodable.write(
    	at com.serotonin.bacnet4j.service.acknowledgement.ReadPropertyMultipleAck.write(
    	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl.sendResponse(
    	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl.access$300(
    	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl$IncomingMessageExecutor.runImpl(
    	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl$
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
    	at java.util.concurrent.ThreadPoolExecutor$


  • Hi Fred,

    I made an adjustment to the SequeceOf class and checked it in. See if it works better for you now.

  • Thanks Matthew, that did the trick.

    Can you share your plans on when you'll be updating the released versions of bacnet4j and modbus4j?


  • Well, yes... I have none. Both projects are stable at the moment though. I'd say it's safe to use builds of the current code.

  • Thanks Matthew,

    I did the build myself for the update you checked in for since I didn't see an updated jar file. The rest of my code is relative to the latest release published on sourceforge.

    If I can avoid it, I never like building 3rd party libraries.


  • If it's any consolation, the ANT scripts in the repo are what i use to create the builds, so you'll get from that exactly what you'd get from me.