knowm / XChange

XChange is a Java library providing a streamlined API for interacting with 60+ Bitcoin and Altcoin exchanges providing a consistent interface for trading and accessing market data.
http://knowm.org/open-source/xchange/
MIT License
3.87k stars 1.94k forks source link

null (HTTP status code: 200). #4930

Closed NobSxD closed 3 months ago

NobSxD commented 3 months ago

I am encountering the following error when submitting a limit order: org.knowm.xchange.exceptions.ExchangeException: null (HTTP status code: 200). Upon investigating, I received the following response from the exchange:

{
  "symbol": "BTCUSDT",
  "orderId": 29252855170,
  "orderListId": -1,
  "clientOrderId": "144824008",
  "transactTime": 1722841699154,
  "price": "50000.00000000",
  "origQty": "0.00022000",
  "executedQty": "0.00000000",
  "cummulativeQuoteQty": "0.00000000",
  "status": "NEW",
  "timeInForce": "GTC",
  "type": "LIMIT",
  "side": "BUY",
  "workingTime": 1722841699154,
  "fills": [],
  "selfTradePreventionMode": "EXPIRE_MAKER"
}

Additionally, the following debug information is logged:

14:08:19.939 [default] [main] DEBUG si.mazi.rescu.ResponseReader - Parsing response as class org.knowm.xchange.binance.dto.trade.BinanceNewOrder failed: com.fasterxml.jackson.databind.exc.MismatchedInputException: Unexpected token (VALUE_STRING), expected START_OBJECT: need JSON Object to contain As.WRAPPER_OBJECT type information for class org.knowm.xchange.binance.dto.trade.TimeInForce
 at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1, column: 256] (through reference chain: org.knowm.xchange.binance.dto.trade.BinanceNewOrder["timeInForce"])

It appears that the Jackson deserializer expects a JSON object for the timeInForce field in the BinanceNewOrder class, but instead, it receives a string. At the same time, the order itself is executed on the exchange.

  version - 5.2.1-SNAPSHOT

here are the stacktrace errors:

14:08:14.932 [default] [main] DEBUG si.mazi.rescu.Config - Configuration from rescu.properties: 
14:08:14.933 [default] [main] DEBUG si.mazi.rescu.Config - httpConnTimeout = 30000 
14:08:14.935 [default] [main] DEBUG si.mazi.rescu.Config - httpReadTimeout = 30000 
14:08:14.935 [default] [main] DEBUG si.mazi.rescu.Config - proxyHost = null 
14:08:14.935 [default] [main] DEBUG si.mazi.rescu.Config - proxyPort = null 
14:08:14.935 [default] [main] DEBUG si.mazi.rescu.Config - proxyType = null 
14:08:14.935 [default] [main] DEBUG si.mazi.rescu.Config - ignoreHttpErrorCodes = false 
14:08:14.998 [default] [main] DEBUG si.mazi.rescu.HttpTemplate - Executing GET request at https://api.binance.com/sapi/v1/asset/assetDetail?timestamp=1722841694995&signature=9df776e2f8f367bf20e0449b1991adca3ba5267992215dd6178085b8aa7b61db 
14:08:14.999 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Request headers = {X-MBX-APIKEY=sgZ7Dh5wGnDKqELXibieKDFuYI2gApRw9lJAdzwdNvdJ6KDOoIQcZLdnw0vMeGE2, Accept=application/json} 
14:08:15.140 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header request property: key='Accept-Charset', value='UTF-8' 
14:08:15.141 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header request property: key='User-Agent', value='ResCU JDK/6 AppleWebKit/535.7 Chrome/16.0.912.36 Safari/535.7' 
14:08:15.141 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header request property: key='X-MBX-APIKEY', value='sgZ7Dh5wGnDKqELXibieKDFuYI2gApRw9lJAdzwdNvdJ6KDOoIQcZLdnw0vMeGE2' 
14:08:15.141 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header request property: key='Accept', value='application/json' 
14:08:16.113 [default] [main] DEBUG si.mazi.rescu.HttpTemplate - Request http status = 200 
14:08:16.113 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Cache', value='[Miss from cloudfront]' 
14:08:16.113 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Server', value='[nginx]' 
14:08:16.113 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Access-Control-Allow-Origin', value='[*]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-SAPI-USED-IP-WEIGHT-1M', value='[1]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Access-Control-Allow-Methods', value='[GET, HEAD, OPTIONS]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Content-Type-Options', value='[nosniff]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Amz-Cf-Pop', value='[HEL51-P1]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Connection', value='[keep-alive]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Pragma', value='[no-cache]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Content-Security-Policy', value='[default-src 'self']' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Date', value='[Mon, 05 Aug 2024 07:08:15 GMT]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Via', value='[1.1 d6095b4d9fa82f5d25465246e397ad4e.cloudfront.net (CloudFront)]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-WebKit-CSP', value='[default-src 'self']' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Frame-Options', value='[SAMEORIGIN]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Strict-Transport-Security', value='[max-age=31536000; includeSubdomains]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Cache-Control', value='[no-cache, no-store, must-revalidate]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Content-Security-Policy', value='[default-src 'self']' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Xss-Protection', value='[1; mode=block]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Amz-Cf-Id', value='[itEZdejRzkRQVM81DxtYH7ffYT_Zb54hhXiEXBRcvNPkeoRD3ZB6_w==]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Vary', value='[Accept-Encoding]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Expires', value='[0]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Content-Length', value='[77022]' 
14:08:16.114 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Content-Type', value='[application/json]' 
14:08:16.631 [default] [main] DEBUG si.mazi.rescu.HttpTemplate - Http call returned 200; response body:
{"AGLD":{"withdrawFee":"20","minWithdrawAmount":"40","withdrawStatus":true,"depositStatus":true},"MXN":{"withdrawFee":"0","minWithdrawAmount":"0","withdrawStatus":true,"depositStatus":true},"STPT":{"withdrawFee":"351","minWithdrawAmount":"702","withdrawStatus":true,"depositStatus":true},"MATICUSDCE":{"withdrawFee":"0.06","minWithdrawAmount":"0.12","withdrawStatus":true,"depositStatus":true},"ATEM":{"withdrawFee":"17","minWithdrawAmount":"34","withdrawStatus":true,"depositStatus":true},"UGX":{"withdrawFee":"0","minWithdrawAmount":"0","withdrawStatus":true,"depositStatus":true},"RENBTC":{"withdrawFee":"0.0002","minWithdrawAmount":"0.0004","withdrawStatus":true,"depositStatus":false},"GLM":{"withdrawFee":"52","minWithdrawAmount":"104","withdrawStatus":true,"depositStatus":true},"RAY":{"withdrawFee":"0.85","minWithdrawAmount":"1.7","withdrawStatus":true,"depositStatus":true},"NEAR":{"withdrawFee":"0.018","minWithdrawAmount":"0.6","withdrawStatus":true,"depositStatus":true},"AUDIO":{"withdrawFee":"118","minWithdrawAmount":"236","withdrawStatus":true,"depositStatus":true},"WLD":{"withdrawFee":"8.71","minWithdrawAmount":"17","withdrawStatus":true,"depositStatus":true},"HNT":{"withdrawFee":"0.55","minWithdrawAmount":"1","withdrawStatus":true,"depositStatus":false},"ETHFI":{"withdrawFee":"10","minWithdrawAmount":"20","withdrawStatus":true,"depositStatus":true},"CDT":{"withdrawFee":"27","minWithdrawAmount":"54","withdrawStatus":true,"depositStatus":false,"depositTip":"Wallet Maintenance, Deposit Suspended"},"FDUSD":{"withdrawFee":"0.38","minWithdrawAmount":"0.76","withdrawStatus":true,"depositStatus":true},"SPARTA":{"withdrawFee":"0.45","minWithdrawAmount":"0.9","withdrawStatus":true,"depositStatus":false},"MIMATIC":{"withdrawFee":"0.31","minWithdrawAmount":"0.62","withdrawStatus":true,"depositStatus":true},"SUSD":{"withdrawFee":"7","minWithdrawAmount":"20","withdrawStatus":true,"depositStatus":false,"depositTip":"Wallet Maintenance, Deposit Suspended"},"FARM":{"withdrawFee":"0.4","minWithdrawAmount":"0.8","withdrawStatus":true,"depositStatus":true},"ZRO":{"withdrawFee":"4.26","minWithdrawAmount":"8.52","withdrawStatus":true,"depositStatus":true},"SDG":{"withdrawFee":"0","minWithdrawAmount":"0","withdrawStatus":true,"depositStatus":true},"XNO":{"withdrawFee":"0.041","minWithdrawAmount":"0.082","withdrawStatus":true,"depositStatus":true},"AION":{"withdrawFee":"0.1","minWithdrawAmount":"0.2","withdrawStatus":false,"depositStatus":false,"depositTip":"Wallet Maintenance, Deposit Suspended"},"NPXS":{"withdrawFee":"59","minWithdrawAmount":"118","withdrawStatus":false,"depositStatus":false},"DGB":{"withdrawFee":"0.004","minWithdrawAmount":"0.4","withdrawStatus":true,"depositStatus":true},"AVAOLD":{"withdrawFee":"0.77","minWithdrawAmount":"1.54","withdrawStatus":false,"depositStatus":true},"DGD":{"withdrawFee":"0.16","minWithdrawAmount":"0.32","withdrawStatus":true,"depositStatus":false,"depositTip":"Wallet Maintenance, Deposit Suspended"},"ZRX":{"withdrawFee":"51","minWithdrawAmount":"102","withdrawStatus":true,"depositStatus":true},"BCD":{"withdrawFee":"0.01","minWithdrawAmount":"0.02","withdrawStatus":true,"depositStatus":false,"depositTip":"Wallet Maintenance, Deposit Suspended"},"EASY":{"withdrawFee":"0.55","minWithdrawAmount":"1.1","withdrawStatus":true,"depositStatus":false},"SANTOS":{"withdrawFee":"0.16","minWithdrawAmount":"0.32","withdrawStatus":true,"depositStatus":true},"STGOLD":{"withdrawFee":"0.2","minWithdrawAmount":"5","withdrawStatus":false,"depositStatus":true},"WING":{"withdrawFee":"0.0035","minWithdrawAmount":"0.007","withdrawStatus":true,"depositStatus":true},"AE":{"withdrawFee":"0","minWithdrawAmount":"1","withdrawStatus":false,"depositStatus":false},"WNXM":{"withdrawFee":"0.2","minWithdrawAmount":"0.4","withdrawStatus":false,"depositStatus":false},"BCH":{"withdrawFee":"0.00025","minWithdrawAmount":"0.002","withdrawStatus":true,"depositStatus":true},"AI":{"withdrawFee":"1.16","minWithdrawAmount":"2.32","withdrawStatus":true,"depositStatus":true},"JST":{"withdrawFee":"50","minWithdrawAmount":"100","withdrawStatus":tru 
14:08:16.680 [default] [main] DEBUG si.mazi.rescu.HttpTemplate - Executing GET request at https://api.binance.com/api/v3/exchangeInfo 
14:08:16.680 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Request headers = {Accept=application/json} 
14:08:16.680 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header request property: key='Accept-Charset', value='UTF-8' 
14:08:16.680 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header request property: key='User-Agent', value='ResCU JDK/6 AppleWebKit/535.7 Chrome/16.0.912.36 Safari/535.7' 
14:08:16.680 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header request property: key='Accept', value='application/json' 
14:08:17.263 [default] [main] DEBUG si.mazi.rescu.HttpTemplate - Request http status = 200 
14:08:17.263 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Server', value='[nginx]' 
14:08:17.263 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Access-Control-Allow-Origin', value='[*]' 
14:08:17.263 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Access-Control-Allow-Methods', value='[GET, HEAD, OPTIONS]' 
14:08:17.263 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Frame-Options', value='[SAMEORIGIN]' 
14:08:17.263 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Strict-Transport-Security', value='[max-age=31536000; includeSubdomains]' 
14:08:17.264 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='x-mbx-used-weight', value='[20]' 
14:08:17.264 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Content-Security-Policy', value='[default-src 'self']' 
14:08:17.264 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='x-mbx-uuid', value='[ee56510f-c035-4701-ae4e-ffa8aa6b4c45]' 
14:08:17.264 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Amz-Cf-Id', value='[dtOuT1bKeviG93wKK7L8uanPAe8GmJPI4585TmhyLTcvRNWNACn7yw==]' 
14:08:17.264 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Content-Length', value='[5864691]' 
14:08:17.264 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Content-Type', value='[application/json;charset=UTF-8]' 
14:08:17.264 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Cache', value='[Miss from cloudfront]' 
14:08:17.264 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Content-Type-Options', value='[nosniff]' 
14:08:17.264 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Amz-Cf-Pop', value='[HEL51-P1]' 
14:08:17.264 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Connection', value='[keep-alive]' 
14:08:17.264 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Pragma', value='[no-cache]' 
14:08:17.265 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Content-Security-Policy', value='[default-src 'self']' 
14:08:17.265 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Date', value='[Mon, 05 Aug 2024 07:08:16 GMT]' 
14:08:17.265 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Via', value='[1.1 d6095b4d9fa82f5d25465246e397ad4e.cloudfront.net (CloudFront)]' 
14:08:17.265 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-WebKit-CSP', value='[default-src 'self']' 
14:08:17.265 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Cache-Control', value='[no-cache, no-store, must-revalidate]' 
14:08:17.265 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Xss-Protection', value='[1; mode=block]' 
14:08:17.265 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='x-mbx-used-weight-1m', value='[20]' 
14:08:17.265 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Vary', value='[Accept-Encoding]' 
14:08:17.265 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Expires', value='[0]' 
14:08:19.300 [default] [main] DEBUG si.mazi.rescu.HttpTemplate - Http call returned 200; response body:
{"timezone":"UTC","serverTime":1722841696266,"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000},{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":100},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":200000},{"rateLimitType":"RAW_REQUESTS","interval":"MINUTE","intervalNum":5,"limit":61000}],"exchangeFilters":[],"symbols":[{"symbol":"ETHBTC","status":"TRADING","baseAsset":"ETH","baseAssetPrecision":8,"quoteAsset":"BTC","quotePrecision":8,"quoteAssetPrecision":8,"baseCommissionPrecision":8,"quoteCommissionPrecision":8,"orderTypes":["LIMIT","LIMIT_MAKER","MARKET","STOP_LOSS","STOP_LOSS_LIMIT","TAKE_PROFIT","TAKE_PROFIT_LIMIT"],"icebergAllowed":true,"ocoAllowed":true,"otoAllowed":true,"quoteOrderQtyMarketAllowed":true,"allowTrailingStop":true,"cancelReplaceAllowed":true,"isSpotTradingAllowed":true,"isMarginTradingAllowed":true,"filters":[{"filterType":"PRICE_FILTER","minPrice":"0.00001000","maxPrice":"922327.00000000","tickSize":"0.00001000"},{"filterType":"LOT_SIZE","minQty":"0.00010000","maxQty":"100000.00000000","stepSize":"0.00010000"},{"filterType":"ICEBERG_PARTS","limit":10},{"filterType":"MARKET_LOT_SIZE","minQty":"0.00000000","maxQty":"1319.42421375","stepSize":"0.00000000"},{"filterType":"TRAILING_DELTA","minTrailingAboveDelta":10,"maxTrailingAboveDelta":2000,"minTrailingBelowDelta":10,"maxTrailingBelowDelta":2000},{"filterType":"PERCENT_PRICE_BY_SIDE","bidMultiplierUp":"5","bidMultiplierDown":"0.2","askMultiplierUp":"5","askMultiplierDown":"0.2","avgPriceMins":5},{"filterType":"NOTIONAL","minNotional":"0.00010000","applyMinToMarket":true,"maxNotional":"9000000.00000000","applyMaxToMarket":false,"avgPriceMins":5},{"filterType":"MAX_NUM_ORDERS","maxNumOrders":200},{"filterType":"MAX_NUM_ALGO_ORDERS","maxNumAlgoOrders":5}],"permissions":[],"permissionSets":[["SPOT","MARGIN","TRD_GRP_004","TRD_GRP_005","TRD_GRP_006","TRD_GRP_008","TRD_GRP_009","TRD_GRP_010","TRD_GRP_011","TRD_GRP_012","TRD_GRP_013","TRD_GRP_014","TRD_GRP_015","TRD_GRP_016","TRD_GRP_017","TRD_GRP_018","TRD_GRP_019","TRD_GRP_020","TRD_GRP_021","TRD_GRP_022","TRD_GRP_023","TRD_GRP_024","TRD_GRP_025","TRD_GRP_026","TRD_GRP_027","TRD_GRP_028","TRD_GRP_029","TRD_GRP_030","TRD_GRP_031","TRD_GRP_032","TRD_GRP_033","TRD_GRP_034","TRD_GRP_035","TRD_GRP_036","TRD_GRP_037","TRD_GRP_038","TRD_GRP_039","TRD_GRP_040","TRD_GRP_041","TRD_GRP_042","TRD_GRP_043","TRD_GRP_044","TRD_GRP_045","TRD_GRP_046","TRD_GRP_047","TRD_GRP_048","TRD_GRP_049"]],"defaultSelfTradePreventionMode":"EXPIRE_MAKER","allowedSelfTradePreventionModes":["EXPIRE_TAKER","EXPIRE_MAKER","EXPIRE_BOTH"]},{"symbol":"LTCBTC","status":"TRADING","baseAsset":"LTC","baseAssetPrecision":8,"quoteAsset":"BTC","quotePrecision":8,"quoteAssetPrecision":8,"baseCommissionPrecision":8,"quoteCommissionPrecision":8,"orderTypes":["LIMIT","LIMIT_MAKER","MARKET","STOP_LOSS","STOP_LOSS_LIMIT","TAKE_PROFIT","TAKE_PROFIT_LIMIT"],"icebergAllowed":true,"ocoAllowed":true,"otoAllowed":true,"quoteOrderQtyMarketAllowed":true,"allowTrailingStop":true,"cancelReplaceAllowed":true,"isSpotTradingAllowed":true,"isMarginTradingAllowed":true,"filters":[{"filterType":"PRICE_FILTER","minPrice":"0.00000100","maxPrice":"100000.00000000","tickSize":"0.00000100"},{"filterType":"LOT_SIZE","minQty":"0.00100000","maxQty":"100000.00000000","stepSize":"0.00100000"},{"filterType":"ICEBERG_PARTS","limit":10},{"filterType":"MARKET_LOT_SIZE","minQty":"0.00000000","maxQty":"4048.80538333","stepSize":"0.00000000"},{"filterType":"TRAILING_DELTA","minTrailingAboveDelta":10,"maxTrailingAboveDelta":2000,"minTrailingBelowDelta":10,"maxTrailingBelowDelta":2000},{"filterType":"PERCENT_PRICE_BY_SIDE","bidMultiplierUp":"5","bidMultiplierDown":"0.2","askMultiplierUp":"5","askMultiplierDown":"0.2","avgPriceMins":5},{"filterType":"NOTIONAL","minNotional":"0.00010000","applyMinToMarket":true,"maxNotional":"9000000.00000000","applyMaxToMarket":false,"avgPriceMins":5},{"filterType":"MAX_NUM_ORDERS","maxNumOrders":200},{"filterType":"MAX_NUM_ALGO_ORDERS","maxNumAlgoOrders":5}],"permissi 
14:08:19.568 [default] [main] DEBUG si.mazi.rescu.HttpTemplate - Executing POST request at https://api.binance.com/api/v3/order?signature=edea13539669b3b13570806ae6b00d6facc67e005978243bec63c98f768bc1db  body 
symbol=BTCUSDT&side=BUY&type=LIMIT&timeInForce=GTC&quantity=0.00022&price=50000&newClientOrderId=144824008×tamp=1722841699567 
14:08:19.568 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Request headers = {X-MBX-APIKEY=sgZ7Dh5wGnDKqELXibieKDFuYI2gApRw9lJAdzwdNvdJ6KDOoIQcZLdnw0vMeGE2, Accept=application/json} 
14:08:19.568 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header request property: key='Accept-Charset', value='UTF-8' 
14:08:19.568 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header request property: key='User-Agent', value='ResCU JDK/6 AppleWebKit/535.7 Chrome/16.0.912.36 Safari/535.7' 
14:08:19.569 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header request property: key='X-MBX-APIKEY', value='sgZ7Dh5wGnDKqELXibieKDFuYI2gApRw9lJAdzwdNvdJ6KDOoIQcZLdnw0vMeGE2' 
14:08:19.569 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header request property: key='Accept', value='application/json' 
14:08:19.889 [default] [main] DEBUG si.mazi.rescu.HttpTemplate - Request http status = 200 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Server', value='[nginx]' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Access-Control-Allow-Origin', value='[*]' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Access-Control-Allow-Methods', value='[GET, HEAD, OPTIONS]' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Frame-Options', value='[SAMEORIGIN]' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Strict-Transport-Security', value='[max-age=31536000; includeSubdomains]' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='x-mbx-used-weight', value='[21]' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Content-Security-Policy', value='[default-src 'self']' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='x-mbx-uuid', value='[14e5b3b1-c99b-4403-a10c-378e07e4c886]' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Amz-Cf-Id', value='[-5vb06BAtHO2wX4vQX24pDppXWQqQP_XagYxWsUjXyXfi0Dt8ugFug==]' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Content-Length', value='[369]' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Content-Type', value='[application/json;charset=UTF-8]' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Cache', value='[Miss from cloudfront]' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='x-mbx-order-count-10s', value='[1]' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Content-Type-Options', value='[nosniff]' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Amz-Cf-Pop', value='[HEL51-P1]' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Connection', value='[keep-alive]' 
14:08:19.890 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Pragma', value='[no-cache]' 
14:08:19.891 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Content-Security-Policy', value='[default-src 'self']' 
14:08:19.891 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Date', value='[Mon, 05 Aug 2024 07:08:19 GMT]' 
14:08:19.891 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Via', value='[1.1 d6095b4d9fa82f5d25465246e397ad4e.cloudfront.net (CloudFront)]' 
14:08:19.891 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-WebKit-CSP', value='[default-src 'self']' 
14:08:19.891 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Cache-Control', value='[no-cache, no-store, must-revalidate]' 
14:08:19.891 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='X-Xss-Protection', value='[1; mode=block]' 
14:08:19.891 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='x-mbx-order-count-1d', value='[6]' 
14:08:19.891 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='x-mbx-used-weight-1m', value='[21]' 
14:08:19.891 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Vary', value='[Accept-Encoding]' 
14:08:19.891 [default] [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Expires', value='[0]' 
14:08:19.891 [default] [main] DEBUG si.mazi.rescu.HttpTemplate - Http call returned 200; response body:
{"symbol":"BTCUSDT","orderId":29252855170,"orderListId":-1,"clientOrderId":"144824008","transactTime":1722841699154,"price":"50000.00000000","origQty":"0.00022000","executedQty":"0.00000000","cummulativeQuoteQty":"0.00000000","status":"NEW","timeInForce":"GTC","type":"LIMIT","side":"BUY","workingTime":1722841699154,"fills":[],"selfTradePreventionMode":"EXPIRE_MAKER"} 
14:08:19.939 [default] [main] DEBUG si.mazi.rescu.ResponseReader - Parsing response as class org.knowm.xchange.binance.dto.trade.BinanceNewOrder failed: com.fasterxml.jackson.databind.exc.MismatchedInputException: Unexpected token (VALUE_STRING), expected START_OBJECT: need JSON Object to contain As.WRAPPER_OBJECT type information for class org.knowm.xchange.binance.dto.trade.TimeInForce
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 256] (through reference chain: org.knowm.xchange.binance.dto.trade.BinanceNewOrder["timeInForce"]) 

org.knowm.xchange.exceptions.ExchangeException: null (HTTP status code: 200)

    at org.knowm.xchange.binance.BinanceErrorAdapter.adapt(BinanceErrorAdapter.java:51)
    at org.knowm.xchange.binance.service.BinanceTradeService.placeOrderAllProducts(BinanceTradeService.java:223)
    at org.knowm.xchange.binance.service.BinanceTradeService.placeLimitOrder(BinanceTradeService.java:83)
    at org.example.xchange.BasicChange.limitOrder(BasicChange.java:46)
    at org.example.xchange.Binance.trede.BinanceMainImpIntegratio.limitOrder(BinanceMainImpIntegratio.java:89)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: org.knowm.xchange.binance.dto.BinanceException: null (HTTP status code: 200)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
    at com.fasterxml.jackson.databind.introspect.AnnotatedConstructor.call(AnnotatedConstructor.java:126)
    at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromObjectWith(StdValueInstantiator.java:291)
    at com.fasterxml.jackson.databind.deser.ValueInstantiator.createFromObjectWith(ValueInstantiator.java:301)
    at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:202)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:526)
    at com.fasterxml.jackson.databind.deser.std.ThrowableDeserializer.deserializeFromObject(ThrowableDeserializer.java:85)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:185)
    at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:342)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4905)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3848)
    at si.mazi.rescu.serialization.jackson.JacksonResponseReader.read(JacksonResponseReader.java:53)
    at si.mazi.rescu.serialization.jackson.JacksonResponseReader.readException(JacksonResponseReader.java:58)
    at si.mazi.rescu.ResponseReader.read(ResponseReader.java:82)
    at si.mazi.rescu.RestInvocationHandler.mapInvocationResult(RestInvocationHandler.java:169)
    at si.mazi.rescu.RestInvocationHandler.receiveAndMap(RestInvocationHandler.java:157)
    at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:113)
    at jdk.proxy2/jdk.proxy2.$Proxy20.newOrder(Unknown Source)
    at org.knowm.xchange.binance.service.BinanceTradeServiceRaw.lambda$newOrder$2(BinanceTradeServiceRaw.java:108)
    at org.knowm.xchange.client.ResilienceUtils$DecorateCallableApi.call(ResilienceUtils.java:86)
    at org.knowm.xchange.binance.service.BinanceTradeServiceRaw.newOrder(BinanceTradeServiceRaw.java:129)
    at org.knowm.xchange.binance.service.BinanceTradeService.placeOrderAllProducts(BinanceTradeService.java:206)
    ... 6 more

Process finished with exit code -1

NobSxD commented 3 months ago

This problem started after switching to spring-boot 3.1.2 and higher. It helped to add jackson-databind to the dependency.


            com.fasterxml.jackson.core
            jackson-databind
            2.13.4.1