It could be due to many reasons but the one that caused this error in my case was pretty simple. I had generated data control and dragged on my page. At this point the method signature was:
myMethod(int a, int b)
Later on I changed method to:
myMethod(int a, int b, int c)
and regenerated the data control. But I forgot to update the definition in the pageDef of the page. And when I tried to execute the method I got this error.
So I just updated the method definition in my pageDef and everything worked fine :)