cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: Throwing errors in component's initialize() method
Date Fri, 25 Jun 2004 10:44:08 GMT
Bart Molenkamp wrote:

>I've written a component which uses native code. Therefore it needs to
>load native libraries (I do this in the initialize() method) and when
>something goes wrong with that, Errors get thrown (e.g.
>UnsatisfiedLinkError). But Cocoon doesn't seem to recognize this, and it
>looks like Cocoon starts up normally. When some pipeline is invoked, it
>seems that Cocoon is going to reconfigure/initialize itself, resulting
>in even more errors (e.g. HSQLDB that is already started, etc.)
>Is this the desired behaviour? Should I catch any error and rethrow it
>inside some exception, so that Cocoon correctly handles the failure? Or
>is there any way that Cocoon can catch these errors?

Cocoon catches only Exceptions, and not Errors. So the best way is what 
you propose: catch the Error in your initialize() and retrow it, 
cascaded in an Exception.


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

View raw message