cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: Should we catch java.lang.Error? (was RE: XMLForm and sitemap problem (fwd))
Date Thu, 08 May 2003 20:58:15 GMT
Berin Loritsch wrote:

> Stefano Mazzocchi wrote:
>> on 5/8/03 7:30 AM Bruno Dumon wrote:
>>> A method is not required to declare in its throws clause any 
>>> subclasses of Error that might be thrown during the execution of the 
>>> method but not caught, since these errors are abnormal conditions 
>>> that should never occur."
>> Yes, but cocoon is a framework, so it's the pipeline components that 
>> should not try to catch it, but the framework *must* be informed 
>> about it so that framework administrators can do something about it 
>> (presenting a 500 for an OutOfMemory could be very bad marketing for us)
> Out of curiosity, with some issues like the OutOfMemoryError, what 
> practically can be done?  I mean we have to create some pipeline 
> objects to send a response to the user, and it is obvious that garbage 
> collection has not done its job... possibly due to a memory leak in 
> the developer's application (not necessarily Cocoon).
> What about the other errors that exist?

IMO, considering the highly dynamic nature of Cocoon (and every 
Avalon-based system), we should make a special case for errors related 
to classloading, since they may be related more to an initial 
misconfiguration of the system rather than to a runtime problem such as 
OutOfMemoryError. I sometimes had hard times to find the exact same 
problem of a missing library : there was nothing in Cocoon's logs, and I 
only found the problem with Tomcat's log files.

The JDK provides java.lang.LinkageError just for this : "Subclasses of 
|LinkageError| indicate that a class has some dependency on another 
class; however, the latter class has incompatibly changed after the 
compilation of the former class". And it subclasses include 
NoClassDefFoundError, ExceptionInInitializerError, etc.

Furthermore, such LinkageErrors occuring when an Avalon container loads 
a component class should be IMHO handled by the container (and rethrown 
as a ComponentException) rather than being propagated as is the case today.

Thoughts ?


Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

View raw message