getting exception while connecting to websocket

krtrader
Hi,

I am trying to connect to websocket using java client.
TickerProvider object is getting initialized properly but when I call connect() method on tickerProvider object it gives me below error:

java.lang.NullPointerException
at com.zerodhatech.ticker.KiteTicker.connect(KiteTicker.java:216)

Please help
  • krtrader
    i am creating tickerProvider object as below:
    tickerProvider = new KiteTicker(kiteConnect.getUserId(), kiteConnect.getAccessToken(), kiteConnect.getApiKey(), "wss://websocket.kite.trade/v3");
  • krtrader
    below is the error log:

    com.neovisionaries.ws.client.OpeningHandshakeException: The status code of the opening handshake response is not '101 Switching Protocols'. The status line is: HTTP/1.1 400 Bad Request
    at com.neovisionaries.ws.client.HandshakeReader.validateStatusLine(HandshakeReader.java:232)
    at com.neovisionaries.ws.client.HandshakeReader.readHandshake(HandshakeReader.java:54)
    at com.neovisionaries.ws.client.WebSocket.readHandshake(WebSocket.java:3244)
    at com.neovisionaries.ws.client.WebSocket.shakeHands(WebSocket.java:3123)
    at com.neovisionaries.ws.client.WebSocket.connect(WebSocket.java:2155)
    at com.zerodhatech.ticker.KiteTicker.connect(KiteTicker.java:213)
  • sujith
    Hi,
    The URL wss://websocket.kite.trade/v3 is a temporary endpoint. You need to use new endpoint. You just need to pull the latest version of javakiteconnect and use it.
    Please wait for a day or two, we are making some final changes.
  • krtrader
    Hi @sujith

    I have downloaded the kite3 java jar yesterday from https://github.com/zerodhatech/javakiteconnect/tree/kite3/dist
    Do I need to re download the jar again to get correct endpoint? If not then could you please give correct end point here?
  • krtrader
    Hi @sujith

    Is there any problem with above endpoint? which endpoint i should use till you make the final changes? This is blocking my program.
    I was not facing this issue when i was using kite2 java client.
    I upgraded to kite3 yesterday and since then not able to coonect websocket
  • krtrader
    Hi @sujith

    Please help on this
  • sujith
    Yes, we changed the binary file. You can get new binary file here.
This discussion has been closed.