airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1359737 - /incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
Date Tue, 10 Jul 2012 15:52:13 GMT
Author: lahiru
Date: Tue Jul 10 15:52:12 2012
New Revision: 1359737

URL: http://svn.apache.org/viewvc?rev=1359737&view=rev
Log:
fixing a NPE during startup.

Modified:
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java?rev=1359737&r1=1359736&r2=1359737&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
(original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
Tue Jul 10 15:52:12 2012
@@ -1016,7 +1016,7 @@ public class AiravataJCRRegistry extends
 	private Node getWorkflowExperimentDataNode(String experimentId,
 			Session session) throws RepositoryException {
 		return getOrAddNode(getOrAddNode(getWorkflowDataNode(session),
-		                experimentId),experimentId);
+                experimentId),experimentId);
 	}
 
 	private Node getWorkflowDataNode(Session session)
@@ -1138,7 +1138,7 @@ public class AiravataJCRRegistry extends
             session = getSession();
             List<String> matchingExperimentIds = getMatchingExperimentIds(regex, session);
             for(String experimentId:matchingExperimentIds){
-            	WorkflowIOData workflowOutputData = getWorkflowExecutionOutput(experimentId,outputName);
+            	WorkflowIOData workflowOutputData = getWorkflowExecutionOutput(experimentId,
outputName);
                 workflowStatusMap.put(experimentId,workflowOutputData);
             }
 		} catch (RepositoryException e) {
@@ -1598,11 +1598,14 @@ public class AiravataJCRRegistry extends
         Properties properties = new Properties();
 		URL url = this.getClass().getClassLoader().getResource(REPOSITORY_PROPERTIES);
         if (url!=null) {
-			try {
-				properties.load(url.openStream());
-				String provRegAccessorClass = properties.getProperty("class.provenance.registry.accessor");
-				Class<AiravataProvenanceRegistry> provenanceRegistryClass = (Class<AiravataProvenanceRegistry>)
getClass().getClassLoader().loadClass(provRegAccessorClass);
-				provenanceRegistry=(AiravataProvenanceRegistry)provenanceRegistryClass.getConstructor(String.class).newInstance(getUsername());
+            try {
+                properties.load(url.openStream());
+                String provenanceClass = "class.provenance.registry.accessor";
+                String provRegAccessorClass = properties.getProperty(provenanceClass, null);
+                if (provRegAccessorClass != null) {
+                    Class<AiravataProvenanceRegistry> provenanceRegistryClass = (Class<AiravataProvenanceRegistry>)
getClass().getClassLoader().loadClass(provRegAccessorClass);
+                    provenanceRegistry = provenanceRegistryClass.getConstructor(String.class).newInstance(getUsername());
+                }
 			} catch (ClassNotFoundException e) {
 				e.printStackTrace();
 			} catch (IllegalArgumentException e) {



Mime
View raw message