Skip to content

Exception is thrown while connecting to tarantool instance #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
highpower opened this issue Aug 7, 2019 · 0 comments · Fixed by #216
Closed

Exception is thrown while connecting to tarantool instance #215

highpower opened this issue Aug 7, 2019 · 0 comments · Fixed by #216
Labels
bug Something isn't working

Comments

@highpower
Copy link

Exception in thread "Tarantool connector" java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;
at org.tarantool.protocol.ProtoUtils.connect(ProtoUtils.java:183)
at org.tarantool.TarantoolClientImpl.connect(TarantoolClientImpl.java:199)
at org.tarantool.TarantoolClientImpl.reconnect(TarantoolClientImpl.java:184)
at org.tarantool.TarantoolClientImpl$1.run(TarantoolClientImpl.java:97)
at java.lang.Thread.run(Thread.java:748)

Both connector library and my program are built by the same compiler on macos.

o-obolenskiy:nosqltest o.obolenskiy$ java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)

@Totktonada Totktonada added the bug Something isn't working label Aug 7, 2019
nicktorwald pushed a commit that referenced this issue Aug 22, 2019
Tarantool client uses java.nio.ByteBuffer to represent a payload to be
sent through the network. JDK 9 introduces a number of new methods that
override java.nio.Buffer methods in order to return ByteBuffer instead
of Buffer. Because of overriding, those methods are available in JRE 8
or below but cannot be invoked if the connector is built using JDK 9 or
above using new signatures for methods overridden. To be compatible
with JREs before 9, it possible to cast ByteBuffer to Buffer class
explicitly. As a result, a method will be called which is available in
older versions but it breaks conciseness of the code.

Closes: #215
Totktonada pushed a commit that referenced this issue Aug 30, 2019
Tarantool client uses java.nio.ByteBuffer to represent a payload to be
sent through the network. JDK 9 introduces a number of new methods that
override java.nio.Buffer methods in order to return ByteBuffer instead
of Buffer. Because of overriding, those methods are available in JRE 8
or below but cannot be invoked if the connector is built using JDK 9 or
above using new signatures for methods overridden. To be compatible
with JREs before 9, it possible to cast ByteBuffer to Buffer class
explicitly. As a result, a method will be called which is available in
older versions but it breaks conciseness of the code.

Closes: #215
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants