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 2013/10/22 17:58:21 UTC

svn commit: r1534680 - /uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccAdmin.java

Author: cwiklik
Date: Tue Oct 22 15:58:21 2013
New Revision: 1534680

URL: http://svn.apache.org/r1534680
Log:
UIMA-3367 improve error message 

Modified:
    uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccAdmin.java

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccAdmin.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccAdmin.java?rev=1534680&r1=1534679&r2=1534680&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccAdmin.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/main/DuccAdmin.java Tue Oct 22 15:58:21 2013
@@ -103,13 +103,18 @@ public class DuccAdmin extends AbstractD
 //				context.addComponent("activemq",
 //						ActiveMQComponent.activeMQComponent(brokerUrl));
 			    
-			    if ( brokerCredentialsFile != null ) {
-			      String path = Utils.resolvePlaceholderIfExists(brokerCredentialsFile, System.getProperties());
-		    	  Credentials credentials = BrokerCredentials.get(path);
-				  if ( credentials.getUsername() != null && credentials.getPassword() != null ) {
-					duccAMQComponent.setUserName(credentials.getUsername());
-					duccAMQComponent.setPassword(credentials.getPassword());
-		 		  }   
+			    if ( brokerCredentialsFile != null && brokerCredentialsFile.length() > 0 ) {
+			    	try {
+					      String path = Utils.resolvePlaceholderIfExists(brokerCredentialsFile, System.getProperties());
+				    	  Credentials credentials = BrokerCredentials.get(path);
+						  if ( credentials.getUsername() != null && credentials.getPassword() != null ) {
+							duccAMQComponent.setUserName(credentials.getUsername());
+							duccAMQComponent.setPassword(credentials.getPassword());
+				 		  }   
+			    	} catch(FileNotFoundException e) {
+						System.out.println("DuccAdmin Failed - File Not Found:"+brokerCredentialsFile);
+						System.exit(-1);
+			    	}
 			    }
 				context.addComponent("activemq",duccAMQComponent);
 				this.pt = context.createProducerTemplate();