I can't see why you'd get a StackOverflowError. However, writing a class called "Error" is a decidedly bad idea and might be causing you problems.
There is a built-in class called "Error" in the java.lang package. That package is automatically imported into all code.
You should never name your classes the same as any class in java.lang .
You should generally avoid naming your classes the same as any built-in class from any package, too, though this is more an advice than a hard-and-fast rule.
Additional (16 Aug) Ah, later posters have identified that the problem is absence of "static" in those lines which construct instances of Error.
[ August 16, 2006: Message edited by: Peter Chase ]