I had the same problem. I noticed it only occures when you have List as argument.
My solution is to wrap the list in another Object:
class YourObjectList {
private List items;
// constructor, getter and setter
}
With that single object, i had no more problems with class cast exception.