getting error while access token with KITE 3.0

darshankarkar
Hello

just we are migrate kite 3.0

we are using spring 4.0 project. and import https://github.com/zerodhatech/javakiteconnect/tree/kite3/dist Jar.

Our code is as below

public User generateUserTokenFromKite(User user, String request_token) {try {
KiteConnect kiteconnect = new KiteConnect(environment.getProperty(ApplicationEnum.KITEAPPID.getValue()));
kiteconnect.setUserId(environment.getProperty(ApplicationEnum.KITEUSERID.getValue()));
kiteconnect.setSessionExpiryHook(new SessionExpiryHook() {
@Override public void sessionExpired(){System.out.println("session expired"); }});
com.zerodhatech.models.User userModel = kiteconnect.generateSession(request_token,environment.getProperty(ApplicationEnum.KITEAPPSECRET.getValue()));
user.setRequestToken(request_token);
UserKiteDetail userKiteDetail = new UserKiteDetail();
userKiteDetail.setMemberId(userModel.email);
//userKiteDetail.setProduct(userModel.product);
userKiteDetail.setUserName(userModel.userName);
userKiteDetail.setBroker(userModel.broker);
userKiteDetail.setAccessToken(userModel.accessToken);
userKiteDetail.setPublicToken(userModel.publicToken);
userKiteDetail.setUserType(userModel.userType);
userKiteDetail.setUserId(userModel.userId);
//userKiteDetail.setLoginTime(userModel.loginTime);
user.setUserKiteDetail(userKiteDetail);
kiteconnect.setAccessToken(userModel.accessToken);
kiteconnect.setPublicToken(userModel.publicToken);
} catch (KiteException e) {e.printStackTrace();} catch (JSONException e) {
e.printStackTrace();} catch (IOException e) {e.printStackTrace();}
return user;}

==================================================================================

But we are getting Error as below,


Jun 02, 2018 8:46:47 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/tradtool] threw exception [Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: okio.BufferedSource.rangeEquals(JLokio/ByteString;)Z] with root cause
java.lang.NoSuchMethodError: okio.BufferedSource.rangeEquals(JLokio/ByteString;)Z
at okhttp3.internal.Util.bomAwareCharset(Util.java:431)
at okhttp3.ResponseBody.string(ResponseBody.java:174)
at com.zerodhatech.kiteconnect.kitehttp.KiteRequestHandler.postRequest(KiteRequestHandler.java:84)
at com.zerodhatech.kiteconnect.KiteConnect.generateSession(KiteConnect.java:180)

==================================================================================
we are using below maven dependency


com.fasterxml.jackson.core
jackson-core
2.9.3



com.fasterxml.jackson.core
jackson-annotations
2.9.3



com.fasterxml.jackson.core
jackson-databind
2.9.3




com.squareup.retrofit2
retrofit
2.3.0



com.squareup.retrofit2
converter-jackson
2.3.0



com.squareup.okhttp3
logging-interceptor
3.9.1



Please someone help me bring me out over here.
Tagged:
Sign In or Register to comment.