I've run into an odd problem while developing a servlet
for tomcat, using ecs to generate html output.

Just thought I'd post this, to help anyone else who
hits the same problem, and maybe someone will patch ecs
to fix this (or at least make the failure more graceful).

It took me a while to work out. I searched for "fatal"
and "stack" in the archives, but couldn't find anything.

I don't have a test case yet, but the basic issue appears
to be as follows:

given the following (incorrect) code:

TR tr = new TR();
TD td = new TD();
td.addElement("some content");
tr.addElement(tr);

when tr.toString() is called, the jvm (or at least tomcat,
which is managing my servlet) drops dead, with no stack trace
available.

Of course that last line should have been:

tr.addElement(td);

but I've been working too hard recently.

I suspect that adding an element to itself sets up some kind
of horrible infinite recursion inside ecs. Some kind of check that
"this != element", and an appropriate exception should ensure that
an appropriate error message is generated, rather than sudden tomcat
death ...






--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to