Error in ./gradlew run --args='trades.json 2020-01-01'

How to solve this error?
java.lang.ClassCastException: java.util.ArrayList cannot be cast to com.crio.warmup.stock.dto.TiingoCandle

You are trying to convert a full ArrayList to a single object. You can either take each element from List and use it by converting it to TiingoCandle or you can convert whole ArrayList to List of TiingoCandle type.

1 Like

You are trying to convert an ArrayList into a List of Objects. That isn’t possible. Try peeking the definition of TiingoCandle and you will know what to do.