Ok, thanks, But could you tell me why it catches only exceptions, and not errors? (Just interested).
Bart. -----Original Message----- From: Sylvain Wallez [mailto:[EMAIL PROTECTED] Sent: Friday, June 25, 2004 12:44 PM To: [EMAIL PROTECTED] Subject: Re: Throwing errors in component's initialize() method Bart Molenkamp wrote: >Hello, > >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 -- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
