Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-2324

NoSuchMethodError java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer when running 2.2.27.Final on Java 8

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.2.28.Final, 2.2.28.SP1
    • 2.2.27.Final
    • Core
    • None

      Running 2.2.27.Final on Java 8 fails due to a NoSuchMethodError:

      Caused by: java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;
      	at io.undertow.server.DefaultByteBufferPool.allocate(DefaultByteBufferPool.java:157)
      	at io.undertow.server.protocol.http.HttpOpenListener.<init>(HttpOpenListener.java:90)
      	at io.undertow.Undertow.start(Undertow.java:182) 

      In Java 8, the clear method is on Buffer, the super-class of ByteBuffer. In Java 9, ByteBuffer started overriding clear() to return ByteBuffer. I wonder if 2.2.27 was compiled against the Java 9 (or later) API resulting in the bytecode referencing the method that returns ByteBuffer which does not exist in Java 8?

            flaviarnn Flavia Rainone
            ankinson Andy Wilkinson
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: