Sorry to revive this thread. The problem had been gone for a while and therefore I hadn't sent the lens for repair. But then, today something happened that made me wonder what the problem really was.
I was using the 17-55mm on my 7D and today there were occasionally error messages (communication between the lens and the body is faulty. Clean the lens contact) when I tried to take pictures. In order not to miss the moment, I changed the lens to a manual-focus Takuma 50mm. But then even that manual lens had the same error message! The adapter is AF-confirming but the body detected nothing. When I changed back to 17-55mm, I could take some pictures, though occasionally the error appeared.
So, would it be the body that has the problem? But in the past 3 months I've been using it with either 17-55mm or 70-200mm. Especially for the latter, I have never run into this problem. If I should send something to Canon for checkup, should it be the 17-55mm or the 7D body?