Author: cwiklik
Date: Mon Mar  5 19:42:46 2012
New Revision: 1297198

URL: http://svn.apache.org/viewvc?rev=1297198&view=rev
Log:
UIMA-2377 Forgot to check the type of Throwable before calling System.exit. 
Only uncaught java errors should trigger jvm exit

Modified:
    
uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaAsThreadFactory.java

Modified: 
uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaAsThreadFactory.java
URL: 
http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaAsThreadFactory.java?rev=1297198&r1=1297197&r2=1297198&view=diff
==============================================================================
--- 
uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaAsThreadFactory.java
 (original)
+++ 
uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaAsThreadFactory.java
 Mon Mar  5 19:42:46 2012
@@ -117,17 +117,20 @@ public class UimaAsThreadFactory impleme
             // TaskExecutor is terminated.
             r.run();
           } catch (Throwable e) {
-            //   try to log. If this is OOM, logging may not succeed and we
-            //   get another OOM.
-            try {
-              UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, 
getClass().getName(),
-                      "UimaAsThreadFactory", 
UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
-                      "UIMAEE_exception__WARNING", e);
-              System.out.println("Exiting UIMA AS Process Due to Uncaught 
Exception");
-            } catch( Throwable t ) {
-               // Failed during logging. We are tight on memory. Just exit 
+            if ( !(e instanceof Exception) ) {
+              //   try to log. If this is OOM, logging may not succeed and we
+              //   get another OOM.
+              try {
+                UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, 
getClass().getName(),
+                        "UimaAsThreadFactory", 
UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
+                        "UIMAEE_exception__WARNING", e);
+                System.out.println(">>>>>>>>>>>>>>>>>>Exiting UIMA AS Process 
Due to Uncaught Exception");
+              } catch( Throwable t ) {
+                 // Failed during logging. We are tight on memory. Just exit 
+              }
+              System.exit(-1);
+              
             }
-            System.exit(-1);
             return;
           } finally {
               if ( controller instanceof 
PrimitiveAnalysisEngineController_impl ) {


Reply via email to