NullPointer Exception while deserializing

Exception in thread “main” com.fasterxml.jackson.databind.exc.ValueInstantiationException: Cannot construct instance of com.crio.warmup.stock.dto.AlphavantageCandle, problem: java.lang.NullPointerException at [Source: (File); line: 11, column: 13] (through reference chain: com.crio.warmup.stock.dto.AlphavantageDailyResponse[“Time Series (Daily)”]->java.util.LinkedHashMap[“2020-03-05”])

Unable to proceed forward, please offer some insight.

Can you please refer to the below FAQ link and let me know whether it was helpful or not.

Is this an interface?

Hi @Animesh,

I believe you are facing this error because you might have missed adding JsonProperty annotations, as specified in the milestone. Possibly, your LinkedHashMap is pointing to a null value when the key is “2020-03-05”.

This may also be happening because you might be trying to access the value at this key, which does not exist.

I’ll recommend you try proceeding on these solutions, see what happens and then inform us. We’ll help accordingly!

I’m closing this topic due to no response from anyone since last 12 hours. If your query is resolved you can mark any reply as a solution. If you still have the query, please create a new topic paste the link of this topic in the description.