cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bart Molenkamp" <>
Subject RE: Throwing errors in component's initialize() method
Date Fri, 25 Jun 2004 10:48:40 GMT
Ok, thanks,

But could you tell me why it catches only exceptions, and not errors?
(Just interested). 


-----Original Message-----
From: Sylvain Wallez [] 
Sent: Friday, June 25, 2004 12:44 PM
Subject: Re: Throwing errors in component's initialize() method

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
>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