You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sh...@apache.org on 2014/11/07 01:11:31 UTC

[16/23] airavata git commit: re-arrange server and clint code to create seperate distributions. AIRAVATA-1471

re-arrange server and clint code to create seperate distributions.
AIRAVATA-1471

Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/a133fa8c
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/a133fa8c
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/a133fa8c

Branch: refs/heads/gfac_appcatalog_int
Commit: a133fa8c341cc29e88890a7093a40b795301fab3
Parents: f415e99
Author: Raminder <ra...@apache.org>
Authored: Wed Nov 5 15:56:41 2014 -0500
Committer: Raminder <ra...@apache.org>
Committed: Wed Nov 5 15:56:41 2014 -0500

----------------------------------------------------------------------
 airavata-api/airavata-api-server/pom.xml        |    2 +-
 .../airavata/api/server/WorkflowServer.java     |  164 -
 .../server/handler/AiravataServerHandler.java   |  223 +-
 .../server/handler/WorkflowServerHandler.java   |    2 +-
 .../api/client/AiravataClientFactory.java       |    5 +-
 .../apache/airavata/api/workflow/Workflow.java  | 8191 ------------------
 .../api/workflow/workflowAPIConstants.java      |   56 -
 modules/distribution/api-server/pom.xml         |  203 +
 .../src/main/assembly/bin-assembly.xml          |  137 +
 .../src/main/assembly/src-assembly.xml          |   74 +
 .../api-server/src/main/resources/INSTALL       |   55 +
 .../api-server/src/main/resources/LICENSE       | 2387 +++++
 .../api-server/src/main/resources/NOTICE        |  163 +
 .../api-server/src/main/resources/README        |  121 +
 .../src/main/resources/bin/api-server.sh        |  118 +
 .../api-server/src/main/resources/bin/logo.txt  |   34 +
 modules/distribution/gfac-server/pom.xml        |  486 ++
 .../src/main/assembly/bin-assembly.xml          |  305 +
 .../src/main/assembly/src-assembly.xml          |   75 +
 .../gfac-server/src/main/resources/INSTALL      |   55 +
 .../gfac-server/src/main/resources/LICENSE      | 2387 +++++
 .../gfac-server/src/main/resources/NOTICE       |  163 +
 .../gfac-server/src/main/resources/README       |  121 +
 .../src/main/resources/bin/gfac-server.sh       |  118 +
 .../gfac-server/src/main/resources/bin/logo.txt |   34 +
 .../distribution/orchestrator-server/pom.xml    |  325 +
 .../src/main/assembly/bin-assembly.xml          |  230 +
 .../src/main/assembly/src-assembly.xml          |   75 +
 .../src/main/resources/INSTALL                  |   55 +
 .../src/main/resources/LICENSE                  | 2387 +++++
 .../src/main/resources/NOTICE                   |  163 +
 .../src/main/resources/README                   |  121 +
 .../src/main/resources/bin/logo.txt             |   34 +
 .../main/resources/bin/orchestrator-server.sh   |  118 +
 modules/distribution/pom.xml                    |    5 +-
 modules/distribution/server/pom.xml             |   22 +-
 .../server/src/main/assembly/bin-assembly.xml   |    3 +
 modules/gfac/airavata-gfac-service/pom.xml      |    5 +
 modules/gfac/airavata-gfac-stubs/pom.xml        |   60 +
 .../airavata/gfac/client/GFACInstance.java      |   62 +
 .../airavata/gfac/client/GFacClientFactory.java |   42 +
 .../apache/airavata/gfac/cpi/GfacService.java   | 2867 ++++++
 .../gfac/cpi/gfac_cpi_serviceConstants.java     |   55 +
 modules/gfac/pom.xml                            |    1 +
 .../airavata-orchestrator-service/pom.xml       |   10 +
 .../client/OrchestratorClientFactory.java       |   45 -
 .../orchestrator/cpi/OrchestratorService.java   | 4467 ----------
 .../cpi/orchestrator_cpi_serviceConstants.java  |   55 -
 .../server/OrchestratorServerHandler.java       |  180 +-
 .../orchestrator/util/DataModelUtils.java       |   53 +
 .../util/OrchestratorRecoveryHandler.java       |    2 +-
 .../OrchestratorServerThreadPoolExecutor.java   |   35 +
 .../airavata-orchestrator-stubs/pom.xml         |   60 +
 .../client/OrchestratorClientFactory.java       |   44 +
 .../orchestrator/cpi/OrchestratorService.java   | 4568 ++++++++++
 .../cpi/orchestrator_cpi_serviceConstants.java  |   55 +
 .../sample/OrchestratorClientSample.java        |  134 +
 .../orchestrator-client-sdks/pom.xml            |   70 -
 .../client/sample/OrchestratorClientSample.java |  138 -
 modules/orchestrator/orchestrator-core/pom.xml  |    7 +-
 .../core/context/OrchestratorContext.java       |    3 +-
 .../orchestrator/core/gfac/GFACInstance.java    |   62 -
 .../core/gfac/GFacClientFactory.java            |   42 -
 .../core/impl/GFACEmbeddedJobSubmitter.java     |    6 +-
 .../core/impl/GFACServiceJobSubmitter.java      |    6 +-
 .../orchestrator/core/job/JobSubmitter.java     |    3 +-
 .../orchestrator/core/BaseOrchestratorTest.java |    9 -
 .../orchestrator.cpi.service.thrift             |    2 +-
 modules/orchestrator/pom.xml                    |    2 +-
 modules/workflow-model/workflow-engine/pom.xml  |    7 +-
 .../workflow/engine/WorkflowEngineImpl.java     |    5 +-
 modules/xbaya-gui/pom.xml                       |    7 +-
 .../dialogs/workflow/WorkflowImportWindow.java  |    2 +-
 .../RegistryWorkflowPublisherWindow.java        |    4 +-
 .../WorkflowInterpreterLaunchWindow.java        |    9 +-
 .../apache/airavata/xbaya/util/XBayaUtil.java   |    2 +-
 76 files changed, 18800 insertions(+), 13603 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/a133fa8c/airavata-api/airavata-api-server/pom.xml
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/pom.xml b/airavata-api/airavata-api-server/pom.xml
index 8526510..e8a0f5b 100644
--- a/airavata-api/airavata-api-server/pom.xml
+++ b/airavata-api/airavata-api-server/pom.xml
@@ -63,7 +63,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-orchestrator-service</artifactId>
+            <artifactId>airavata-orchestrator-stubs</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>

http://git-wip-us.apache.org/repos/asf/airavata/blob/a133fa8c/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/WorkflowServer.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/WorkflowServer.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/WorkflowServer.java
deleted file mode 100644
index e9ce328..0000000
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/WorkflowServer.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-
-package org.apache.airavata.api.server;
-
-import java.net.InetSocketAddress;
-
-import org.apache.airavata.api.server.handler.WorkflowServerHandler;
-import org.apache.airavata.api.server.util.AppCatalogInitUtil;
-import org.apache.airavata.api.server.util.Constants;
-import org.apache.airavata.api.workflow.Workflow;
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.common.utils.IServer;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.model.error.AiravataErrorType;
-import org.apache.airavata.model.error.AiravataSystemException;
-import org.apache.thrift.server.TServer;
-import org.apache.thrift.server.TThreadPoolServer;
-import org.apache.thrift.transport.TServerSocket;
-import org.apache.thrift.transport.TServerTransport;
-import org.apache.thrift.transport.TTransportException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WorkflowServer implements IServer{
-
-    private final static Logger logger = LoggerFactory.getLogger(WorkflowServer.class);
-	private static final String SERVER_NAME = "Airavata Workflow API Server";
-	private static final String SERVER_VERSION = "1.0";
-
-    private ServerStatus status;
-
-	private TServer server;
-
-	public WorkflowServer() {
-		setStatus(ServerStatus.STOPPED);
-	}
-	
-    public void StartAiravataServer(Workflow.Processor<Workflow.Iface> appCatalogServerHandler) throws AiravataSystemException {
-        try {
-            AiravataUtils.setExecutionAsServer();
-//            AppCatalogInitUtil.initializeDB();
-            final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.WORKFLOW_SERVER_PORT,"8931"));
-            final String serverHost = ServerSettings.getSetting(Constants.WORKFLOW_SERVER_HOST, null);
-            
-			TServerTransport serverTransport;
-			
-			if(serverHost == null){
-				serverTransport = new TServerSocket(serverPort);
-			}else{
-				InetSocketAddress inetSocketAddress = new InetSocketAddress(serverHost, serverPort);
-				serverTransport = new TServerSocket(inetSocketAddress);
-			}
-			
-			server = new TThreadPoolServer(new TThreadPoolServer.Args(serverTransport).processor(appCatalogServerHandler));
-            new Thread() {
-				public void run() {
-					server.serve();
-					setStatus(ServerStatus.STOPPED);
-					logger.info("Airavata Workflow Server Stopped.");
-				}
-			}.start();
-			new Thread() {
-				public void run() {
-					while(!server.isServing()){
-						try {
-							Thread.sleep(500);
-						} catch (InterruptedException e) {
-							break;
-						}
-					}
-					if (server.isServing()){
-						setStatus(ServerStatus.STARTED);
-			            logger.info("Starting Airavata Workflow Server on Port " + serverPort);
-			            logger.info("Listening to Workflow API Clients ....");
-					}
-				}
-			}.start();
-        } catch (TTransportException e) {
-            logger.error(e.getMessage());
-            setStatus(ServerStatus.FAILED);
-            throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
-        }
-    }
-
-    public static void main(String[] args) {
-    	try {
-			WorkflowServer server = new WorkflowServer();
-			server.start();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-    }
-
-	@Override
-	public void start() throws Exception {
-		setStatus(ServerStatus.STARTING);
-		Workflow.Processor<Workflow.Iface> server =
-                new Workflow.Processor<Workflow.Iface>(new WorkflowServerHandler());
-    	StartAiravataServer(server);
-	}
-
-	@Override
-	public void stop() throws Exception {
-		if (server.isServing()){
-			setStatus(ServerStatus.STOPING);
-			server.stop();
-		}
-		
-	}
-
-	@Override
-	public void restart() throws Exception {
-		stop();
-		start();
-	}
-
-	@Override
-	public void configure() throws Exception {
-		// TODO Auto-generated method stub
-		
-	}
-
-	@Override
-	public ServerStatus getStatus() throws Exception {
-		return status;
-	}
-	
-	private void setStatus(ServerStatus stat){
-		status=stat;
-		status.updateTime();
-	}
-
-	@Override
-	public String getName() {
-		return SERVER_NAME;
-	}
-
-	@Override
-	public String getVersion() {
-		return SERVER_VERSION;
-	}
-
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/a133fa8c/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index 9eb9c23..0e94f9f 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -86,88 +86,6 @@ public class AiravataServerHandler implements Airavata.Iface {
         }
     }
 
-//    private void storeServerConfig() throws ApplicationSettingsException {
-//        String zkhostPort = AiravataZKUtils.getZKhostPort();
-//        String airavataServerHostPort = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.API_SERVER_HOST)
-//                            + ":" + ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.API_SERVER_PORT);
-//
-//        try {
-//            zk = new ZooKeeper(zkhostPort, 6000, this);   // no watcher is required, this will only use to store some data
-//            String apiServer = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_API_SERVER_NODE,"/airavata-server");
-//            String OrchServer = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_ORCHESTRATOR_SERVER_NODE,"/orchestrator-server");
-//            String gfacServer = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_GFAC_SERVER_NODE,"/gfac-server");
-//            String gfacExperiments = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_GFAC_EXPERIMENT_NODE,"/gfac-experiments");
-//
-//            synchronized (mutex) {
-//                mutex.wait();  // waiting for the syncConnected event
-//            }
-//            Stat zkStat = zk.exists(apiServer, false);
-//            if (zkStat == null) {
-//                zk.create(apiServer, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
-//                        CreateMode.PERSISTENT);
-//            }
-//            String instantNode = apiServer + File.separator + String.valueOf(new Random().nextInt(Integer.MAX_VALUE));
-//            zkStat = zk.exists(instantNode, false);
-//            if (zkStat == null) {
-//                zk.create(instantNode,
-//                        airavataServerHostPort.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
-//                        CreateMode.EPHEMERAL);      // other component will watch these childeren creation deletion to monitor the status of the node
-//                logger.info("Successfully created airavata-server node");
-//            }
-//
-//            zkStat = zk.exists(OrchServer, false);
-//            if (zkStat == null) {
-//                zk.create(OrchServer, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
-//                        CreateMode.PERSISTENT);
-//                logger.info("Successfully created orchestrator-server node");
-//            }
-//            zkStat = zk.exists(gfacServer, false);
-//            if (zkStat == null) {
-//                zk.create(gfacServer, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
-//                        CreateMode.PERSISTENT);
-//                logger.info("Successfully created gfac-server node");
-//            }
-//            zkStat = zk.exists(gfacServer, false);
-//            if (zkStat == null) {
-//                zk.create(gfacExperiments, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
-//                        CreateMode.PERSISTENT);
-//                logger.info("Successfully created gfac-server node");
-//            }
-//            logger.info("Finished starting ZK: " + zk);
-//        } catch (IOException e) {
-//            e.printStackTrace();
-//        } catch (InterruptedException e) {
-//            e.printStackTrace();
-//        } catch (KeeperException e) {
-//            e.printStackTrace();
-//        }
-//    }
-//    synchronized public void process(WatchedEvent watchedEvent) {
-//        synchronized (mutex) {
-//            Event.KeeperState state = watchedEvent.getState();
-//            logger.info(state.name());
-//            if (state == Event.KeeperState.SyncConnected) {
-//                mutex.notify();
-//            } else if(state == Event.KeeperState.Expired ||
-//                    state == Event.KeeperState.Disconnected){
-//                try {
-//                    mutex = -1;
-//                    zk = new ZooKeeper(AiravataZKUtils.getZKhostPort(), 6000, this);
-//                    synchronized (mutex) {
-//                        mutex.wait();  // waiting for the syncConnected event
-//                    }
-//                    storeServerConfig();
-//                } catch (IOException e) {
-//                    e.printStackTrace();
-//                } catch (ApplicationSettingsException e) {
-//                    e.printStackTrace();
-//                } catch (InterruptedException e) {
-//                    e.printStackTrace();
-//                }
-//            }
-//        }
-//    }
-
     /**
      * Query Airavata to fetch the API version
      */
@@ -1154,138 +1072,25 @@ public class AiravataServerHandler implements Airavata.Iface {
             exception.setMessage("Error while retrieving projects. More info : " + e1.getMessage());
             throw exception;
         }
-
-        final String expID = airavataExperimentId;
-        final String token = airavataCredStoreToken;
-        synchronized (this) {
-    		Experiment experiment = getExperiment(expID);
-			ExecutionType executionType = DataModelUtils.getExecutionType(experiment);
-			Thread thread = null;
-			if (executionType==ExecutionType.SINGLE_APP) {
-                //its an single application execution experiment
-                logger.debugId(airavataExperimentId, "Launching single application experiment {}.", airavataExperimentId);
-                final OrchestratorService.Client orchestratorClient = getOrchestratorClient();
-                if (orchestratorClient.validateExperiment(expID)) {
-                   AiravataServerThreadPoolExecutor.getFixedThreadPool().execute(new SingleAppExperimentRunner(expID, token, orchestratorClient));
-                } else {
-                    logger.errorId(airavataExperimentId, "Experiment validation failed. Please check the configurations.");
-                    throw new InvalidRequestException("Experiment Validation Failed, please check the configuration");
-                }
-
-            } else if (executionType == ExecutionType.WORKFLOW){
-					//its a workflow execution experiment
-                logger.debugId(airavataExperimentId, "Launching workflow experiment {}.", airavataExperimentId);
-					thread = new Thread() {
-	                    public void run() {
-	                        try {
-                        		launchWorkflowExperiment(expID, token);
-	                        } catch (TException e) {
-                                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-							}
-	                    }
-	                };
-                thread.start();
-            } else {
-                logger.errorId(airavataExperimentId, "Couldn't identify experiment type, experiment {} is neither single application nor workflow.", airavataExperimentId);
-                throw new InvalidRequestException("Experiment '" + expID + "' launch failed. Unable to figureout execution type for application " + experiment.getApplicationId());
-            }
-        }
-    }
-
-    private void launchWorkflowExperiment(String experimentId, String airavataCredStoreToken) throws TException {
-    	try {
-			WorkflowEngine workflowEngine = WorkflowEngineFactory.getWorkflowEngine();
-			workflowEngine.launchExperiment(experimentId, airavataCredStoreToken);
-		} catch (WorkflowEngineException e) {
-            logger.errorId(experimentId, "Error while launching experiment.", e);
+    	Experiment experiment = getExperiment(airavataExperimentId);
+    	OrchestratorService.Client orchestratorClient = getOrchestratorClient();
+    	if (orchestratorClient.validateExperiment(airavataExperimentId)) {
+    		orchestratorClient.launchExperiment(airavataExperimentId, airavataCredStoreToken);
+    	}else {
+            logger.errorId(airavataExperimentId, "Couldn't identify experiment type, experiment {} is neither single application nor workflow.", airavataExperimentId);
+            throw new InvalidRequestException("Experiment '" + airavataExperimentId + "' launch failed. Unable to figureout execution type for application " + experiment.getApplicationId());
         }
     }
 
-    private class SingleAppExperimentRunner implements Runnable {
-
-        String experimentId;
-        String airavataCredStoreToken;
-        Client client;
-        public SingleAppExperimentRunner(String experimentId,String airavataCredStoreToken,Client client){
-            this.experimentId = experimentId;
-            this.airavataCredStoreToken = airavataCredStoreToken;
-            this.client = client;
-        }
-        @Override
-        public void run() {
-            try {
-                launchSingleAppExperiment();
-            } catch (TException e) {
-                e.printStackTrace();
-            }
-        }
-
-        private boolean launchSingleAppExperiment() throws TException {
-            Experiment experiment = null;
-            try {
-                List<String> ids = registry.getIds(RegistryModelType.WORKFLOW_NODE_DETAIL, WorkflowNodeConstants.EXPERIMENT_ID, experimentId);
-                for (String workflowNodeId : ids) {
-//                WorkflowNodeDetails workflowNodeDetail = (WorkflowNodeDetails) registry.get(RegistryModelType.WORKFLOW_NODE_DETAIL, workflowNodeId);
-                    List<Object> taskDetailList = registry.get(RegistryModelType.TASK_DETAIL, TaskDetailConstants.NODE_ID, workflowNodeId);
-                    for (Object o : taskDetailList) {
-                        TaskDetails taskData = (TaskDetails) o;
-                        //iterate through all the generated tasks and performs the job submisssion+monitoring
-                        experiment = (Experiment) registry.get(RegistryModelType.EXPERIMENT, experimentId);
-                        if (experiment == null) {
-                            logger.errorId(experimentId, "Error retrieving the Experiment by the given experimentID: {}", experimentId);
-                            return false;
-                        }
-                        ExperimentStatus status = new ExperimentStatus();
-                        status.setExperimentState(ExperimentState.LAUNCHED);
-                        status.setTimeOfStateChange(Calendar.getInstance().getTimeInMillis());
-                        experiment.setExperimentStatus(status);
-                        registry.update(RegistryModelType.EXPERIMENT_STATUS, status, experimentId);
-                        if (ServerSettings.isRabbitMqPublishEnabled()) {
-                            String gatewayId = ServerSettings.getDefaultUserGateway();
-                            ExperimentStatusChangeEvent event = new ExperimentStatusChangeEvent(ExperimentState.LAUNCHED,
-                                    experimentId,
-                                    gatewayId);
-                            String messageId = AiravataUtils.getId("EXPERIMENT");
-                            MessageContext messageContext = new MessageContext(event, MessageType.EXPERIMENT, messageId, gatewayId);
-                            messageContext.setUpdatedTime(AiravataUtils.getCurrentTimestamp());
-                            publisher.publish(messageContext);
-                        }
-                        registry.update(RegistryModelType.TASK_DETAIL, taskData, taskData.getTaskID());
-                        //launching the experiment
-                        client.launchTask(taskData.getTaskID(), airavataCredStoreToken);
-                    }
-                }
-
-            } catch (Exception e) {
-                // Here we really do not have to do much because only potential failure can happen
-                // is in gfac, if there are errors in gfac, it will handle the experiment/task/job statuses
-                // We might get failures in registry access before submitting the jobs to gfac, in that case we
-                // leave the status of these as created.
-                ExperimentStatus status = new ExperimentStatus();
-                status.setExperimentState(ExperimentState.FAILED);
-                status.setTimeOfStateChange(Calendar.getInstance().getTimeInMillis());
-                experiment.setExperimentStatus(status);
-                try {
-                    registry.update(RegistryModelType.EXPERIMENT_STATUS, status, experimentId);
-                } catch (RegistryException e1) {
-                    logger.errorId(experimentId, "Error while updating experiment status to " + status.toString(), e);
-                    throw new TException(e);
-                }
-                logger.errorId(experimentId, "Error while updating task status, hence updated experiment status to " + status.toString(), e);
-                throw new TException(e);
-            } finally {
-                client.getOutputProtocol().getTransport().close();
-                client.getInputProtocol().getTransport().close();
-
-            }
-            return true;
-        }
-    }
-    
-	private OrchestratorService.Client getOrchestratorClient() {
+       
+    private OrchestratorService.Client getOrchestratorClient() throws TException{
 		final int serverPort = Integer.parseInt(ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ORCHESTRATOR_SERVER_PORT,"8940"));
         final String serverHost = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ORCHESTRATOR_SERVER_HOST, null);
-        return OrchestratorClientFactory.createOrchestratorClient(serverHost, serverPort);
+        try {
+			return OrchestratorClientFactory.createOrchestratorClient(serverHost, serverPort);
+		} catch (AiravataClientConnectException e) {
+			throw new TException(e);
+		}
 	}
 
     /**

http://git-wip-us.apache.org/repos/asf/airavata/blob/a133fa8c/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/WorkflowServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/WorkflowServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/WorkflowServerHandler.java
index 5efc7e0..db7779d 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/WorkflowServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/WorkflowServerHandler.java
@@ -25,7 +25,7 @@ import java.util.List;
 
 import org.airavata.appcatalog.cpi.AppCatalogException;
 import org.airavata.appcatalog.cpi.WorkflowCatalog;
-import org.apache.airavata.api.workflow.Workflow.Iface;
+import org.apache.airavata.api.Workflow.Iface;
 import org.apache.airavata.model.Workflow;
 import org.apache.airavata.model.error.AiravataClientException;
 import org.apache.airavata.model.error.AiravataErrorType;

http://git-wip-us.apache.org/repos/asf/airavata/blob/a133fa8c/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/client/AiravataClientFactory.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/client/AiravataClientFactory.java b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/client/AiravataClientFactory.java
index dc6b6e1..dee8ff9 100644
--- a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/client/AiravataClientFactory.java
+++ b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/client/AiravataClientFactory.java
@@ -22,7 +22,8 @@
 package org.apache.airavata.api.client;
 
 import org.apache.airavata.api.Airavata;
-import org.apache.airavata.api.workflow.Workflow;
+
+import org.apache.airavata.api.Workflow;
 //import org.apache.airavata.api.appcatalog.ApplicationCatalogAPI;
 import org.apache.airavata.model.error.AiravataClientConnectException;
 import org.apache.thrift.protocol.TBinaryProtocol;
@@ -60,7 +61,7 @@ public class AiravataClientFactory {
             throw new AiravataClientConnectException("Unable to connect to the server at "+serverHost+":"+serverPort);
         }
     }
-    
+//    
     /*
     public static <T extends org.apache.thrift.TServiceClient> T createApplicationCatalogClient(String serverHost, int serverPort, Class<T> type) throws Exception{
         try {