Uploaded image for project: 'Apache PLC4X'
  1. Apache PLC4X
  2. PLC4X-345

Read coil request throws java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1

    XMLWordPrintableJSON

Details

    Description

      Run hello-world-plc4x java example with cli options:

      --field-addresses 02084 

      Throws exception:

      io.netty.handler.codec.DecoderException: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
          at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:98)
          at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
          at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
          at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
          at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
          at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:327)
          at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:299)
          at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
          at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
          at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
          at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
          at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
          at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
          at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
          at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
          at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
          at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
          at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
          at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
          at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
          at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995)
          at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
          at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
          at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
          at com.github.jinahya.bit.io.ArrayByteInput.read(ArrayByteInput.java:106)
          at com.github.jinahya.bit.io.DefaultBitInput.read(DefaultBitInput.java:57)
          at com.github.jinahya.bit.io.AbstractBitInput.unsigned8(AbstractBitInput.java:63)
          at com.github.jinahya.bit.io.AbstractBitInput.unsigned16(AbstractBitInput.java:92)
          at com.github.jinahya.bit.io.AbstractBitInput.readInt(AbstractBitInput.java:135)
          at org.apache.plc4x.java.spi.generation.ReadBufferByteBased.readUnsignedInt(ReadBufferByteBased.java:174)
          at org.apache.plc4x.java.modbus.readwrite.DataItem.staticParse(DataItem.java:51)
          at org.apache.plc4x.java.modbus.base.protocol.ModbusProtocolLogic.readBooleanList(ModbusProtocolLogic.java:328)
          at org.apache.plc4x.java.modbus.base.protocol.ModbusProtocolLogic.toPlcValue(ModbusProtocolLogic.java:232)
          at org.apache.plc4x.java.modbus.tcp.protocol.ModbusTcpProtocolLogic.lambda$read$2(ModbusTcpProtocolLogic.java:104)
          at org.apache.plc4x.java.spi.Plc4xNettyWrapper.decode(Plc4xNettyWrapper.java:175)
          at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81)
          at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
          ... 23 common frames omitted 

      It is working fine on release 0.9.1

      Attachments

        Activity

          People

            Unassigned Unassigned
            mohammaduvez Mohammaduvez Payawala
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: