Try remounting your lens and/or try a different lens. Your lens may not be making a good connection to the body or the contacts may be a bit oxidized.
If that doesn't fix it, I'd try a different memory card. Sometimes a bad memory card will cause issues. Ditto for the battery (try a different one if you have a spare).