Unexpected character ('/' (code 47))

Getting the below error when try to test the code with a particular end date :

“com.fasterxml.jackson.core.JsonParseException: Unexpected character (’/’ (code 47)): maybe a (non-standard) comment? (not recognized as one since Feature ‘ALLOW_COMMENTS’ not enabled for parser)\n at [Source: (String)”/home/crio-user/workspace/taniksh101099-ME_QMONEY/qmoney/build/resources/main/trades.json"; line: 1, column: 2]"}
com.fasterxml.jackson.core.JsonParseException: Unexpected character (’/’ (code 47)): maybe a (non-standard) comment? (not recognized as one since Feature ‘ALLOW_COMMENTS’ not enabled for parser)

Searched loads of site but not able to solve this error.
I used resolveFileFromResources() in readFileAsString() to return the file as string and passed that to the readValue();

Hey @TanG have you tried to debug this error why are you getting that error or maybe by mistake you have made some unnecessary typos error in trades.json file check these out

I have checked the json file but found no error in that

The stacktrace clearly says you have an extra unexpected character in in json file, with the line number. Just find it and remove it. That’ll help you.

1 Like

[
{
“symbol”: “AAPL”,
“quantity”: 100,
“tradeType”: “BUY”,
“purchaseDate”: “2019-01-02”
},
{
“symbol”: “MSFT”,
“quantity”: 10,
“tradeType”: “BUY”,
“purchaseDate”: “2019-01-02”
},
{
“symbol”: “GOOGL”,
“quantity”: 50,
“tradeType”: “BUY”,
“purchaseDate”: “2019-01-02”
}
]

There is no error in the json file

is your issue resolved?

Did you try running it again?

Yes, Thank you
The issue is resolved.
I don’t know why this error was coming, but after I made a small change regarding the creation of Candle reference, the error was automatically gone.