The error seems to be deep into G4P's event system but I found a strange solution (not realy a solution) to the problem. In my main class (the one derived from PApplet) I defined a method that returns a self defined class. If I remove this method or change the return type to void the error disappears.
I realy need my self defined methods in the main class. I don't know what the two things have to do with each other …. Maybe this is a beginners error but to me it sounds very strange.