Am 18.02.2012 13:01, schrieb Erik Fäßler:
I had an odd problem when I realized not all of my documents were
actually treated by my consumer. I run a traditional CPE with 4
threads. After some time of research I came to note that my
consumer-AE had an exception thrown which I never saw. The exception
is thrown in this collectionProcessComplete method:
...
} catch (SQLException e) {
throw new AnalysisEngineProcessException(e.getNextException());
}
I have to call e.printStackTrace() (or
e.getNextException().printStackTrace()) myself in order to get a
message about the error. I am running UIMA 2.3.1. How can it be an
Exception stays unreported? Have I messed up some logging options or
something? It seems I'm unaware of some fundamental thing about
exception handling in UIMA here and I would rather not have to search
for exceptions myself without knowing they even have been thrown :-)
UIMA catches all exceptions reaching it, even runtime exceptions via
uncaught exception handler. If you properly initialized the UIMA logging
it should report the exceptions (however I cannot tell you how :-) ).
There is another way to get the exceptions:
when you created the cpe instance, e.g. like
CollectionProcessingEngine cpe =
UIMAFramework.produceCollectionProcessingEngine( cpeDesc );
you should add an own implementation of StatusCallbackListener via
cpe.addStatusCallbackListener( cpeStatusListener )
in the StatusCallbackListener there is a method
entityProcessComplete( CAS _cas, EntityProcessStatus _status )
with _status.isException() and _status.getExceptions() you can get the
exceptions occurred during processing and which components were involved
(_status.getFailedComponentNames()).
Kind regards,
Timo
--
Timo Boehme
OntoChem GmbH
H.-Damerow-Str. 4
06120 Halle/Saale
T: +49 345 4780474
F: +49 345 4780471
[email protected]
_____________________________________________________________________
OntoChem GmbH
Geschäftsführer: Dr. Lutz Weber
Sitz: Halle / Saale
Registergericht: Stendal
Registernummer: HRB 215461
_____________________________________________________________________