null error when getting data for spring