-
Notifications
You must be signed in to change notification settings - Fork 622
Got exception from getCandlestickBars() #102
Comments
I am facing the same issue either. Is there any solution found so far? |
Hi, I'm unable to reproduce your problem, running |
Hello @joaopsilva , thanks for quick response. I am trying to use this library for an android project. And importing it from both https://jitpack.io/#binance-exchange/binance-java-api or compiled JAR library. Neither worked so far. My code is straightforward as ;
When I run this, I get ->
This exact result. |
@joaopsilva is there any progress? |
Hi @freezerdragon , I am really unable to reproduce this problem, I've tried on multiple JDKs and it works. The retrofit library has since been updated, could you please update your repo and try again? Thanks. |
Same error here, only affected on Android implementation 'com.github.binance-exchange:binance-java-api:master-SNAPSHOT' Code: BinanceApiRestClient client = BinanceApiClientFactory.newInstance().newRestClient();
List<Candlestick> candlestickBars = client.getCandlestickBars("ZRXETH", CandlestickInterval.HOURLY, 100, null, null);
System.out.println("Candlestick size " + candlestickBars.size()); Error logs: E/AndroidRuntime: FATAL EXCEPTION: Thread-5
Process: cryptomaniac.co.id.cmrandroserver, PID: 21334
com.binance.api.client.exception.BinanceApiException: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.lang.Long` from String "0.00094076": not a valid Long value
at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 17] (through reference chain: java.util.ArrayList[0]->com.binance.api.client.domain.market.Candlestick["closeTime"])
at com.binance.api.client.impl.BinanceApiServiceGenerator.executeSync(BinanceApiServiceGenerator.java:80)
at com.binance.api.client.impl.BinanceApiRestClientImpl.getCandlestickBars(BinanceApiRestClientImpl.java:97)
at tester.CandleTester.start(CandleTester.java:14)
at cryptomaniac.co.id.cmrandroserver.MainActivity.lambda$onCreate$0(MainActivity.java:29)
at cryptomaniac.co.id.cmrandroserver.-$$Lambda$MainActivity$S6Ew4qP_TgBDrVlGukzcTJZjv_A.run(Unknown Source:0)
at java.lang.Thread.run(Thread.java:764)
Caused by: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.lang.Long` from String "0.00094076": not a valid Long value
at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 17] (through reference chain: java.util.ArrayList[0]->com.binance.api.client.domain.market.Candlestick["closeTime"])
at com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:1552)
at com.fasterxml.jackson.databind.DeserializationContext.handleWeirdStringValue(DeserializationContext.java:912)
at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$LongDeserializer._parseLong(NumberDeserializers.java:584)
at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$LongDeserializer.deserialize(NumberDeserializers.java:557)
at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$LongDeserializer.deserialize(NumberDeserializers.java:535)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
at com.fasterxml.jackson.databind.deser.impl.BeanAsArrayDeserializer.deserialize(BeanAsArrayDeserializer.java:119)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1683)
at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1219)
at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:32)
at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:23)
at retrofit2.ServiceMethod.toResponse(ServiceMethod.java:122)
at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:217)
at retrofit2.OkHttpCall.execute(OkHttpCall.java:180)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall.execute(ExecutorCallAdapterFactory.java:91)
at com.binance.api.client.impl.BinanceApiServiceGenerator.executeSync(BinanceApiServiceGenerator.java:72)
at com.binance.api.client.impl.BinanceApiRestClientImpl.getCandlestickBars(BinanceApiRestClientImpl.java:97)
at tester.CandleTester.start(CandleTester.java:14)
at cryptomaniac.co.id.cmrandroserver.MainActivity.lambda$onCreate$0(MainActivity.java:29)
at cryptomaniac.co.id.cmrandroserver.-$$Lambda$MainActivity$S6Ew4qP_TgBDrVlGukzcTJZjv_A.run(Unknown Source:0)
at java.lang.Thread.run(Thread.java:764) |
Added pull request joaopsilva#23 @joaopsilva |
Facing same error.. Any help? |
Still the same... xD |
Hi, I got an exception after calling following code
client.getCandlestickBars(TradingPairSymbols.BTCPairs.ETH_BTC, CandlestickInterval.DAILY);
It seems that the type mapping in [BinanceApiServiceGenerator.java:60] is incorrect.
Stacktrace:
com.binance.api.client.exception.BinanceApiException: com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not construct instance of java.lang.Long from String value ("0.08000000"): not a valid Long value at
[Source: okhttp3.ResponseBody$BomAwareReader@5c25378; line: 1, column: 17] (through reference chain: java.util.ArrayList[0]->com.binance.api.client.domain.market.Candlestick["closeTime"]) at com.binance.api.client.impl.BinanceApiServiceGenerator.executeSync(BinanceApiServiceGenerator.java:60) at com.binance.api.client.impl.BinanceApiRestClientImpl.getCandlestickBars(BinanceApiRestClientImpl.java:89)
at com.binance.api.client.impl.BinanceApiRestClientImpl.getCandlestickBars(BinanceApiRestClientImpl.java:94)
at
com.dpt.ileopard.binanceapitest.MainActivity$4.run(MainActivity.java:117) at java.lang.Thread.run(Thread.java:764)
The text was updated successfully, but these errors were encountered: