I had the same problem as everyone above, but operating my Itunes on a Windows7 PC (Error 4002) - which came up EVERY time i logged into Itunes.
Following RoccoBoy's steps above to the letter didn't quite work for me - however i used his suggestions and tried something similar:
Went to Store, Turned Off Genius altogether. Went back to Store, selected "Turn Genius on", entered login/password, agreed to terms etc as if logging on for first time - and Voila - worked beautifully !!
Subsequently Genius went through the motions of recompiling everything, but all good !!
Just to double-check, i closed itunes appl down, and re-opened it - only this time, NO MORE ERROR 4002 message, and connected to Itunes Store for good measure first go.
This may be an alternative/supplement tip to Roccoboys - particulalry for non Mac users (i.e Windows/PC like me)
Hope this helps someone !!
Cheers 🙂