This is one of those errors that can drive you nuts while you dig down your class hierarchy and find the culprit. You will typically create this error while not realizing it when you change the access modifier on a class that is being returned by a public method. Why? Because if you return a protected or private class from a public method the client of your public method cannot use the class that you just returned.
I know it makes sense but sometime you're coding a way and don't see it. As a good programmer you know you need to keep your scope as narrow as you can; so you change something from public to protected or private and that's that.
After few more minutes of coding you need to compile and then it hits. This happened to me today and I couldn't remember where I made the change and had to dig for it. Note to self: If I make a change in accessibility, immediately try and compile.