You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2018/02/22 14:49:00 UTC
svn commit: r1825071 -
/uima/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/configuration/jp/HttpWorkerThread.java
Author: cwiklik
Date: Thu Feb 22 14:49:00 2018
New Revision: 1825071
URL: http://svn.apache.org/viewvc?rev=1825071&view=rev
Log:
UIMA-5733 logs exceptions which may occur when calling process()
Modified:
uima/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/configuration/jp/HttpWorkerThread.java
Modified: uima/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/configuration/jp/HttpWorkerThread.java
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/configuration/jp/HttpWorkerThread.java?rev=1825071&r1=1825070&r2=1825071&view=diff
==============================================================================
--- uima/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/configuration/jp/HttpWorkerThread.java (original)
+++ uima/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/configuration/jp/HttpWorkerThread.java Thu Feb 22 14:49:00 2018
@@ -301,11 +301,8 @@ public class HttpWorkerThread implements
transaction.getMetaCas().setPerformanceMetrics(metricsWrapper);
} catch( InvocationTargetException ee) {
- // The only way we would be here is if uimaProcessor.process() method failed.
- // In this case, the process method serialized stack trace into binary blob
- // and wrapped it in AnalysisEngineProcessException. The serialized stack
- // trace is available via getMessage() call.
-
+
+ logger.error("run", null, ee);
// This is process error. It may contain user defined
// exception in the stack trace. To protect against
// ClassNotFound, the entire stack trace was serialized.
@@ -324,26 +321,6 @@ public class HttpWorkerThread implements
byte[] serializedException =
(byte[])getLastSerializedErrorMethod.invoke(processorInstance);
-// if ( ee.getCause() instanceof DuccUimaProcessException ) {
-// // The process() exception had been serialized on the user side of the JP since
-// // only there the Classloader has all the classes to serialize the exception.
-// serializedException = ((DuccUimaProcessException)ee.getCause()).getSerializedException();
-// } else {
-// // strip InvocationTargetException
-// serializedException = serializeException(ee.getCause());
-// }
- /*
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- try {
- oos.writeObject(ee.getCause());
- serializedException = baos.toByteArray();
- } catch (Exception e) {
- Exception e2 = new RuntimeException("Ducc Service Failed to Serialize the Cause of Process Failure. Check Service Log for Details");
- oos.writeObject(e2);
- serializedException = baos.toByteArray();
- }
- */
mc.setUserSpaceException(serializedException);
logger.info("run", null, "Work item processing failed - returning serialized exception to the JD");