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 }
