Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 67232 invoked from network); 7 Dec 2006 22:47:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Dec 2006 22:47:37 -0000 Received: (qmail 11964 invoked by uid 500); 7 Dec 2006 22:47:23 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 11725 invoked by uid 500); 7 Dec 2006 22:47:21 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 11668 invoked by uid 99); 7 Dec 2006 22:47:20 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2006 14:47:19 -0800 X-ASF-Spam-Status: No, hits=-8.6 required=10.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2006 14:46:46 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 17D611A9851; Thu, 7 Dec 2006 14:45:47 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r483713 - in /geronimo/server: branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/ branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/ trunk/modules/geronimo-hot-deploy/src/mai... Date: Thu, 07 Dec 2006 22:45:46 -0000 To: scm@geronimo.apache.org From: vamsic007@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061207224547.17D611A9851@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: vamsic007 Date: Thu Dec 7 14:45:45 2006 New Revision: 483713 URL: http://svn.apache.org/viewvc?view=rev&rev=483713 Log: GERONIMO-2402 Redeployment fails after third iteration. o Integrating the patch provided by Rakesh Midha o The Problem is caused by first update operation. The first time hot-deployer tries to update the changes, it redeployes the application which means the application configid is changes. This change is not reflected in hotdeployer list. Which mean next time any operation is done on this application hotdeployer fails because the application configid being used doesn't exist now. o Instead of void the fileUpdated method of DirectoryHotDeployer.java now returns new configId as string, and in DirectoryMonitor.java this configId is updated in actions fileinfo. Modified: geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java Modified: geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java?view=diff&rev=483713&r1=483712&r2=483713 ============================================================================== --- geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java (original) +++ geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java Thu Dec 7 14:45:45 2006 @@ -374,9 +374,10 @@ return config; } - public void fileUpdated(File file, String configId) { + public String fileUpdated(File file, String configId) { log.info("Redeploying " + file.getName()); DeploymentManager mgr = null; + TargetModuleID[] modules = null; try { mgr = getDeploymentManager(); Target[] targets = mgr.getTargets(); @@ -390,7 +391,7 @@ } waitForProgress(po); if (po.getDeploymentStatus().isCompleted()) { - TargetModuleID[] modules = po.getResultTargetModuleIDs(); + modules = po.getResultTargetModuleIDs(); for (int i = 0; i < modules.length; i++) { TargetModuleID result = modules[i]; System.out.print(DeployUtils.reformat("Redeployed " + result.getModuleID() + (targets.length > 1 ? " to " + result.getTarget().getName() : "") + (result.getWebURL() == null ? "" : " @ " + result.getWebURL()), 4, 72)); @@ -410,6 +411,15 @@ log.error("Unable to undeploy", e); } finally { if (mgr != null) mgr.release(); + } + if (modules != null) { + if (modules.length == 1) { + return modules[0].getModuleID(); + } else { + return ""; + } + } else { + return null; } } Modified: geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java?view=diff&rev=483713&r1=483712&r2=483713 ============================================================================== --- geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java (original) +++ geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java Thu Dec 7 14:45:45 2006 @@ -103,7 +103,7 @@ */ boolean fileRemoved(File file, String configId); - void fileUpdated(File file, String configId); + String fileUpdated(File file, String configId); /** * This method returns the module id of an application deployed in the default group. @@ -338,7 +338,15 @@ } } else if (action.action == FileAction.UPDATED_FILE) { workingOnConfigId = action.info.getConfigId(); - listener.fileUpdated(action.child, action.info.getConfigId()); + String result = listener.fileUpdated(action.child, action.info.getConfigId()); + FileInfo update = action.info; + if (result != null) { + if (!result.equals("")) { + update.setConfigId(result); + } else { + update.setConfigId(calculateModuleId(action.child)); + } + } workingOnConfigId = null; } } catch (Exception e) { Modified: geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java?view=diff&rev=483713&r1=483712&r2=483713 ============================================================================== --- geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java (original) +++ geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java Thu Dec 7 14:45:45 2006 @@ -375,9 +375,10 @@ return config; } - public void fileUpdated(File file, String configId) { + public String fileUpdated(File file, String configId) { log.info("Redeploying " + file.getName()); DeploymentManager mgr = null; + TargetModuleID[] modules = null; try { mgr = getDeploymentManager(); Target[] targets = mgr.getTargets(); @@ -391,7 +392,7 @@ } waitForProgress(po); if (po.getDeploymentStatus().isCompleted()) { - TargetModuleID[] modules = po.getResultTargetModuleIDs(); + modules = po.getResultTargetModuleIDs(); for (int i = 0; i < modules.length; i++) { TargetModuleID result = modules[i]; log.info(DeployUtils.reformat("Redeployed " + result.getModuleID() + (targets.length > 1 ? " to " + result.getTarget().getName() : "") + (result.getWebURL() == null ? "" : " @ " + result.getWebURL()), 4, 72)); @@ -411,6 +412,15 @@ log.error("Unable to undeploy", e); } finally { if (mgr != null) mgr.release(); + } + if (modules != null) { + if (modules.length == 1) { + return modules[0].getModuleID(); + } else { + return ""; + } + } else { + return null; } } Modified: geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java?view=diff&rev=483713&r1=483712&r2=483713 ============================================================================== --- geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java (original) +++ geronimo/server/branches/1.2/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java Thu Dec 7 14:45:45 2006 @@ -103,7 +103,7 @@ */ boolean fileRemoved(File file, String configId); - void fileUpdated(File file, String configId); + String fileUpdated(File file, String configId); /** * This method returns the module id of an application deployed in the default group. @@ -338,7 +338,15 @@ } } else if (action.action == FileAction.UPDATED_FILE) { workingOnConfigId = action.info.getConfigId(); - listener.fileUpdated(action.child, action.info.getConfigId()); + String result = listener.fileUpdated(action.child, action.info.getConfigId()); + FileInfo update = action.info; + if (result != null) { + if (!result.equals("")) { + update.setConfigId(result); + } else { + update.setConfigId(calculateModuleId(action.child)); + } + } workingOnConfigId = null; } } catch (Exception e) { Modified: geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java?view=diff&rev=483713&r1=483712&r2=483713 ============================================================================== --- geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java (original) +++ geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java Thu Dec 7 14:45:45 2006 @@ -375,9 +375,10 @@ return config; } - public void fileUpdated(File file, String configId) { + public String fileUpdated(File file, String configId) { log.info("Redeploying " + file.getName()); DeploymentManager mgr = null; + TargetModuleID[] modules = null; try { mgr = getDeploymentManager(); Target[] targets = mgr.getTargets(); @@ -391,7 +392,7 @@ } waitForProgress(po); if (po.getDeploymentStatus().isCompleted()) { - TargetModuleID[] modules = po.getResultTargetModuleIDs(); + modules = po.getResultTargetModuleIDs(); for (int i = 0; i < modules.length; i++) { TargetModuleID result = modules[i]; log.info(DeployUtils.reformat("Redeployed " + result.getModuleID() + (targets.length > 1 ? " to " + result.getTarget().getName() : "") + (result.getWebURL() == null ? "" : " @ " + result.getWebURL()), 4, 72)); @@ -411,6 +412,15 @@ log.error("Unable to undeploy", e); } finally { if (mgr != null) mgr.release(); + } + if (modules != null) { + if (modules.length == 1) { + return modules[0].getModuleID(); + } else { + return ""; + } + } else { + return null; } } Modified: geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java?view=diff&rev=483713&r1=483712&r2=483713 ============================================================================== --- geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java (original) +++ geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java Thu Dec 7 14:45:45 2006 @@ -103,7 +103,7 @@ */ boolean fileRemoved(File file, String configId); - void fileUpdated(File file, String configId); + String fileUpdated(File file, String configId); /** * This method returns the module id of an application deployed in the default group. @@ -338,7 +338,15 @@ } } else if (action.action == FileAction.UPDATED_FILE) { workingOnConfigId = action.info.getConfigId(); - listener.fileUpdated(action.child, action.info.getConfigId()); + String result = listener.fileUpdated(action.child, action.info.getConfigId()); + FileInfo update = action.info; + if (result != null) { + if (!result.equals("")) { + update.setConfigId(result); + } else { + update.setConfigId(calculateModuleId(action.child)); + } + } workingOnConfigId = null; } } catch (Exception e) {