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 2015/04/13 15:12:43 UTC

svn commit: r1673178 - /uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/configuration/jp/HttpWorkerThread.java

Author: cwiklik
Date: Mon Apr 13 13:12:42 2015
New Revision: 1673178

URL: http://svn.apache.org/r1673178
Log:
UIMA-4066 Fixed NPE triggered by an empty msg sent by JD

Modified:
    uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/configuration/jp/HttpWorkerThread.java

Modified: uima/sandbox/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/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/configuration/jp/HttpWorkerThread.java?rev=1673178&r1=1673177&r2=1673178&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/configuration/jp/HttpWorkerThread.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/configuration/jp/HttpWorkerThread.java Mon Apr 13 13:12:42 2015
@@ -164,19 +164,19 @@ public class HttpWorkerThread implements
                     // The JD may not provide a Work Item to process.
 			    	if ( transaction.getMetaCas()!= null) {
     					logger.info("run", null,"Thread:"+Thread.currentThread().getId()+" Recv'd WI:"+transaction.getMetaCas().getSystemKey());
+    					// Confirm receipt of the CAS. 
+    					transaction.setType(Type.Ack);
+    					command = Type.Ack.name();
+    					tid = new TransactionId(major, minor++);
+    					transaction.setTransactionId(tid);
+    					logger.debug("run", null,"Thread:"+Thread.currentThread().getId()+" Sending ACK request - WI:"+transaction.getMetaCas().getSystemKey());
+    					httpClient.execute(transaction, postMethod); 
+    					
+                        logger.debug("run", null,"Thread:"+Thread.currentThread().getId()+" ACK reply recv'd");
                     } else {
     					logger.debug("run", null,"Thread:"+Thread.currentThread().getId()+" Recv'd JD Response, however there is no MetaCas. Sleeping for "+duccComponent.getThreadSleepTime());
                     }
 
-					// Confirm receipt of the CAS. 
-					transaction.setType(Type.Ack);
-					command = Type.Ack.name();
-					tid = new TransactionId(major, minor++);
-					transaction.setTransactionId(tid);
-					logger.debug("run", null,"Thread:"+Thread.currentThread().getId()+" Sending ACK request - WI:"+transaction.getMetaCas().getSystemKey());
-					httpClient.execute(transaction, postMethod); 
-					
-                    logger.debug("run", null,"Thread:"+Thread.currentThread().getId()+" ACK reply recv'd");
                     
 					// if the JD did not provide a Work Item, most likely the CR is
 					// done. In such case, reduce frequency of Get requests