Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

NoSuchMethodError with Guava 24.0-jre and upwards
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=16&t=56644
Page 1 of 1

Author:  Edwin [ Tue 24 Jul, 2018, 22:34 ]
Post subject:  NoSuchMethodError with Guava 24.0-jre and upwards

I have a dependency problem where JForex throws a NoSuchMethodError when being used with a Guava version of 24.0-jre or higher:

2018-07-24 23:27:00,905 [ |[DDS2 Standalone Tr] ERROR c.d.d.t.client.netty.ClientProtocolHandler.exceptionCaught   - com.google.common.util.concurrent.Futures.dereference(Lcom/google/common/util/concurrent/ListenableFuture;)Lcom/google/common/util/concurrent/ListenableFuture;
java.lang.NoSuchMethodError: com.google.common.util.concurrent.Futures.dereference(Lcom/google/common/util/concurrent/ListenableFuture;)Lcom/google/common/util/concurrent/ListenableFuture;
   at com.dukascopy.dds4.transport.netty.AsyncSettableFuture.<init>(AsyncSettableFuture.java:47)
   at com.dukascopy.dds4.transport.netty.AsyncSettableFuture.create(AsyncSettableFuture.java:43)
   at com.dukascopy.dds4.transport.client.netty.ClientProtocolHandler$EventExecutorChannelTask.executeInExecutor(ClientProtocolHandler.java:1105)
   at com.dukascopy.dds4.transport.client.netty.ClientProtocolHandler$EventExecutorChannelTask.executeInExecutor(ClientProtocolHandler.java:1006)
   at com.dukascopy.dds4.transport.client.netty.ClientProtocolHandler.fireFeedbackMessageReceived(ClientProtocolHandler.java:910)
   at com.dukascopy.dds4.transport.client.netty.ClientProtocolHandler.processControlRequest(ClientProtocolHandler.java:598)
   at com.dukascopy.dds4.transport.client.netty.ClientProtocolHandler.channelRead0(ClientProtocolHandler.java:289)
   at com.dukascopy.dds4.transport.client.netty.ClientProtocolHandler.channelRead0(ClientProtocolHandler.java:89)
   at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
   at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
   at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
   at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
   at com.dukascopy.dds4.transport.netty.ChannelTrafficBlocker.channelRead(ChannelTrafficBlocker.java:54)
   at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
   at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
   at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
   at com.dukascopy.dds4.transport.netty.ProtocolEncoderDecoder.channelRead(ProtocolEncoderDecoder.java:134)
   at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
   at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
   at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
   at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
   at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
   at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
   at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
   at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
   at com.dukascopy.dds4.transport.client.netty.ProtocolVersionClientNegotiatorHandler.channelRead(ProtocolVersionClientNegotiatorHandler.java:137)
   at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
   at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
   at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
   at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1407)
   at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1177)
   at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1221)
   at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
   at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
   at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
   at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
   at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
   at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
   at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
   at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
   at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
   at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
   at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
   at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
   at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
   at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
   at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
   at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
   at java.lang.Thread.run(Thread.java:748)


Please remove the deprecated use of com.google.common.util.concurrent.Futures.dereference and/or upgrade the guava dependency so that I can continue using JForex together with other frameworks that require a higher guava version.

Author:  Edwin [ Tue 24 Jul, 2018, 22:46 ]
Post subject:  Re: NoSuchMethodError with Guava 24.0-jre and upwards

Also here is a warning from guava against the use of @Beta annotated classes (of which Futures is one):

Quote:
1. APIs marked with the @Beta annotation at the class or method level are subject to change. They can be modified in any way, or even removed, at any time. If your code is a library itself (i.e. it is used on the CLASSPATH of users outside your own control), you should not use beta APIs, unless you repackage them. If your code is a library, we strongly recommend using the Guava Beta Checker to ensure that you do not use any @Beta APIs!

2. APIs without @Beta will remain binary-compatible for the indefinite future. (Previously, we sometimes removed such APIs after a deprecation period. The last release to remove non-@Beta APIs was Guava 21.0.) Even @Deprecated APIs will remain (again, unless they are @Beta). We have no plans to start removing things again, but officially, we're leaving our options open in case of surprises (like, say, a serious security problem).

3. Serialized forms of ALL objects are subject to change unless noted otherwise. Do not persist these and assume they can be read by a future version of the library.

4. Our classes are not designed to protect against a malicious caller. You should not use them for communication between trusted and untrusted code.

5. For the mainline flavor, we unit-test the libraries using only OpenJDK 1.8 on Linux. Some features, especially in com.google.common.io, may not work correctly in other environments. For the Android flavor, our unit tests run on API level 15 (Ice Cream Sandwich).


See: https://github.com/google/guava

Author:  API Support [ Thu 26 Jul, 2018, 15:19 ]
Post subject:  Re: NoSuchMethodError with Guava 24.0-jre and upwards

Hello,

Unfortunately, at the current moment(until next platform release), we can't update Guava library version. But we will consider this possibility later. Thanks. ;)

  Page 1 of 1