-
Bug
-
Resolution: Done
-
Major
-
4.2.24
-
None
-
False
-
-
False
-
Important
We are seeing the following error when our JGroups application runs on Java 8:
14:31:54,577 ERROR [SystemErr] Exception in thread "NioConnection.Reader [null]-11,pf-11.3,127.0.0.1:7600" 14:31:54,577 ERROR [SystemErr] java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer; 14:31:54,577 ERROR [SystemErr] at org.jgroups.nio.Buffers.readLengthAndData(Buffers.java:159) 14:31:54,577 ERROR [SystemErr] at org.jgroups.blocks.cs.NioConnection._receive(NioConnection.java:243) 14:31:54,577 ERROR [SystemErr] at org.jgroups.blocks.cs.NioConnection$Reader._run(NioConnection.java:479) 14:31:54,577 ERROR [SystemErr] at org.jgroups.blocks.cs.NioConnection$Reader.run(NioConnection.java:467) 14:31:54,577 ERROR [SystemErr] at java.lang.Thread.run(Thread.java:750)
The error prevents the node from receiving messages from other nodes.
I believe this is occurring because JGroups 4.2.24 was compiled with Java 9 or later and the release option was not set to 8. When compiling with Java 11, adding the following line to the <properties> section of the pom.xml seems to fix the problem.
<maven.compiler.release>8</maven.compiler.release>
Compiling with Java 8 would likely also fix the issue.