Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-2777

ReadOnlyBufferException in NioMessage

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 5.2.24, 5.3.5
    • None
    • None

      The following exception happens when sending a NioMessage with a read-only ByteBuffer:

      java.nio.ReadOnlyBufferException
          at java.base/java.nio.ByteBuffer.array(ByteBuffer.java:1507)
          at org.jgroups.NioMessage.writePayload(NioMessage.java:203)
          at org.jgroups.BaseMessage.writeTo(BaseMessage.java:277)
          at org.jgroups.util.Util.writeMessage(Util.java:1427)

      To reproduce:

      new NioMessage(null, ByteBuffer.allocate(1).asReadOnlyBuffer())
                      .writePayload(new ByteArrayDataOutputStream());

              rhn-engineering-bban Bela Ban
              cfredri4 Christian Fredriksson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: