Getting null value for user when generating session
-
Hello Team,
I have developed spring boot application, which incorporate smartapi jar (smartapi-java-1.0.0.jar), but unfortunately when I am trying to place dummy order I am getting null pointer exception i.e. it is complaining user is null, the reason seems to be the session which is getting generated is null, could you please suggest me what has went wrong here as it is very hard to identify without proper error response if request is bad.
FYI I am using predefined method from class SmartConnect.generateSession(String clientCode, String password)
Sample Request :
{
"variety": "NORMAL",
"tradingsymbol": "SBIN-EQ",
"symboltoken": "3045",
"exchange": "NSE",
"transactiontype": "BUY",
"ordertype": "LIMIT",
"producttype": "DELIVERY",
"duration": "DAY",
"price": "100",
"squareoff": "1",
"stoploss": "0",
"quantity": "1"
}Please see below error attached (Highlighted part shows library usage ) :
I am not fully sure if it is related to migration account for that I have also filled up google form
https://docs.google.com/forms/d/e/1FAIpQLSdgpCiDhSBa_bsKsec002e9unbeQkipOLFAKW7DzPvmiowsaw/viewform
Thanks in advance !
Hargun Singh -
@Hargun-Singh I am also facing the same issue and have reported to the support team.
-
@Hargun-Singh Hope issue has Resolved ,u need to use updated V2 jar and pass additional parameter to Generate session
-
@shahroz14 You need to pass totp params in generate session.If you wish to do so reply me on utsav.moradiya3@gmail.com , instantaneous code fix. Before admin releases a solution in language, several algo traders have already adopted this temporary method.
-
@Harman08 You need to pass totp params in generate session.If you wish to do so reply me on utsav.moradiya3@gmail.com , instantaneous code fix. Before admin releases a solution in language, several algo traders have already adopted this temporary method.