Order placement fails intermittently using Java SDK


  • There is no logging enabled on the client SDK, so I cannot see the real reason behind it. This happens sometimes only.

    can you help me debug and tell what's the issue? below are the log statements. this same code runs sometimes. I even added a check to see if the client is connected.

    2025-01-20 05:47:28,402Z [pool-8-thread-1] INFO com.trade.bot.OrbBotLogic - might place buy order on NIFTY23JAN2523300CE if not in DB: {"orderid":null,"exchange":"NFO","symbolToken":null,"transactiontype":"BUY","quantity":350,"price":0.0,"producttype":"INTRADAY","ordertype":"MARKET","duration":"DAY","variety":"NORMAL","tradingsymbol":"NIFTY23JAN2523300CE","triggerprice":null,"squareoff":"0","stoploss":"0","symboltoken":"54937"}
    2025-01-20 05:47:28,446Z [pool-8-thread-1] INFO c.a.s.http.SmartAPIResponseHandler - ***************************
    2025-01-20 05:47:28,446Z [pool-8-thread-1] INFO com.trade.MarketFeedSync - checking if smart connect is still connected with some call User [userName=C**** , userId=C*, mobileNo=, brokerName=, email=, lastLoginTime=null, accessToken=null, refreshToken=null, products=[MARGIN, MIS, NRML, CNC, CO, BO], exchanges=[nse_fo, nse_cm, cde_fo, ncx_fo, bse_fo, bse_cm, mcx_fo], feedToken=null]
    2025-01-20 05:47:28,446Z [pool-8-thread-1] INFO com.trade.bot.OrbBotLogic - market api handle connected, placing order...com.angelbroking.smartapi.models.OrderParams@463464c8
    2025-01-20 05:47:28,508Z [pool-8-thread-1] INFO c.a.s.http.SmartAPIResponseHandler - ***************************
    2025-01-20 05:47:28,508Z [pool-8-thread-1] ERROR c.angelbroking.smartapi.SmartConnect - JSONObject["data"] is not a JSONObject.
    2025-01-20 05:47:28,508Z [pool-8-thread-1] WARN com.trade.bot.OrbBotLogic - Order not sent to broker, so will not persist.


  • @sekharn you can seek help from others on the forum for debugging. Java SDK is working fine.