Coder Social home page Coder Social logo

Exception in thread "main" java.lang.NoSuchMethodError: java.nio.ByteBuffer.rewind()Ljava/nio/ByteBuffer; about milvus-sdk-java HOT 9 OPEN

onestow avatar onestow commented on September 22, 2024
Exception in thread "main" java.lang.NoSuchMethodError: java.nio.ByteBuffer.rewind()Ljava/nio/ByteBuffer;

from milvus-sdk-java.

Comments (9)

onestow avatar onestow commented on September 22, 2024

jdk21 is normal
jdk8 is not support?

from milvus-sdk-java.

xiaofan-luan avatar xiaofan-luan commented on September 22, 2024

https://www.morling.dev/blog/bytebuffer-and-the-dreaded-nosuchmethoderror/

from milvus-sdk-java.

xiaofan-luan avatar xiaofan-luan commented on September 22, 2024

this is a java compilation bug need to be fixed.

@onestow would you mind fix that?

from milvus-sdk-java.

onestow avatar onestow commented on September 22, 2024

I'm sorry, but I haven't had time for anything else recently v_v

from milvus-sdk-java.

xiaofan-luan avatar xiaofan-luan commented on September 22, 2024

/assign @yhmo could you help on it?

from milvus-sdk-java.

yhmo avatar yhmo commented on September 22, 2024

Java SDK is compiled by openjdk 11 with language level 8. Seems this is an issue of ByteBuffer. If it cannot run under jdk 1.8, try use jdk 11 instead.
I need to install 1.8 to test the issue first, I am not sure is any quick solution there.

from milvus-sdk-java.

xiaofan-luan avatar xiaofan-luan commented on September 22, 2024

check the link

...

<maven.compiler.release>8</maven.compiler.release>

...

from milvus-sdk-java.

yhmo avatar yhmo commented on September 22, 2024

maven.compiler.release doesn't resolve this issue.

I tested on my local.

  • compile sdk with openjdk 1.8 and language level 8
    run client with openjdk 1.8 and language level 8, the ByteBuffer works fine
    run client with openjdk 11 and language level 8, the ByteBuffer works fine

  • compile sdk with openjdk 11 and language level 8
    run client with openjdk 1.8 and language level 8, get NoSuchMethod error of ByteBuffer such as rewind()/position()
    run client with openjdk 11 and language level 8, the ByteBuffer works fine

from milvus-sdk-java.

yhmo avatar yhmo commented on September 22, 2024

A possible solution is: compile the SDK with OpenJDK 1.8 and language level 8 from the next version.

There is a potential problem: seems the tensorflow-core-platform could not work under openjdk 1.8. (Currently, we use this lib for Float16Vector examples).

java: cannot access org.tensorflow.ndarray.buffer.ByteDataBuffer
  bad class file: /home/yhmo/.m2/repository/org/tensorflow/ndarray/0.4.0/ndarray-0.4.0.jar!/org/tensorflow/ndarray/buffer/ByteDataBuffer.class
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

from milvus-sdk-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.