From: <st...@us...> - 2010-09-15 09:01:21
|
Revision: 8402 http://smartfrog.svn.sourceforge.net/smartfrog/?rev=8402&view=rev Author: steve_l Date: 2010-09-15 09:01:13 +0000 (Wed, 15 Sep 2010) Log Message: ----------- SFOS-1527 add a hint more diagnostics Modified Paths: -------------- trunk/core/smartfrog/src/org/smartfrog/sfcore/processcompound/PrimHostDeployerImpl.java Modified: trunk/core/smartfrog/src/org/smartfrog/sfcore/processcompound/PrimHostDeployerImpl.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/sfcore/processcompound/PrimHostDeployerImpl.java 2010-09-10 17:15:10 UTC (rev 8401) +++ trunk/core/smartfrog/src/org/smartfrog/sfcore/processcompound/PrimHostDeployerImpl.java 2010-09-15 09:01:13 UTC (rev 8402) @@ -1,37 +1,37 @@ /** (C) Copyright 1998-2004 Hewlett-Packard Development Company, LP -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -For more information: www.smartfrog.org + For more information: www.smartfrog.org -*/ + */ package org.smartfrog.sfcore.processcompound; -import java.net.InetAddress; - import org.smartfrog.sfcore.common.SmartFrogCoreKeys; import org.smartfrog.sfcore.common.SmartFrogDeploymentException; import org.smartfrog.sfcore.common.SmartFrogResolutionException; import org.smartfrog.sfcore.componentdescription.ComponentDescription; +import org.smartfrog.sfcore.logging.LogFactory; +import org.smartfrog.sfcore.logging.LogSF; import org.smartfrog.sfcore.prim.Prim; import org.smartfrog.sfcore.prim.PrimDeployerImpl; import org.smartfrog.sfcore.reference.Reference; -import org.smartfrog.sfcore.logging.LogFactory; -import org.smartfrog.sfcore.logging.LogSF; +import java.net.InetAddress; +import java.rmi.ConnectException; /** * Implements a specialized description deployer. This deployer uses the @@ -46,15 +46,15 @@ public class PrimHostDeployerImpl extends PrimDeployerImpl { /** ProcessLog. This log is used to log into the core log: SF_CORE_LOG */ - private LogSF sflog = LogFactory.sfGetProcessLog(); + private LogSF sflog = LogFactory.sfGetProcessLog(); /** Efficiency holder of sfProcessHost attribute. */ protected static final Reference refProcessHost = - new Reference(SmartFrogCoreKeys.SF_PROCESS_HOST); + new Reference(SmartFrogCoreKeys.SF_PROCESS_HOST); /** Efficiency holder of sfRootLocatorPort attribute. */ protected static final Reference refRootLocatorPort = - new Reference(SmartFrogCoreKeys.SF_ROOT_LOCATOR_PORT); + new Reference(SmartFrogCoreKeys.SF_ROOT_LOCATOR_PORT); /** * Constructs the PrimHostDeployerImpl with ComponentDescription. @@ -90,7 +90,8 @@ name = target.sfResolveHere(SmartFrogCoreKeys.SF_PROCESS_COMPONENT_NAME, false); } throw new SmartFrogDeploymentException(refProcessHost, null, name, target, null, - "illegal sfProcessHost class: found " + hostname + ", of class " + hostname.getClass(), null, + "illegal sfProcessHost class: found " + hostname + ", of class " + hostname + .getClass(), null, hostname); } } catch (SmartFrogResolutionException resex) { @@ -118,18 +119,19 @@ * @throws SmartFrogDeploymentException if failed to deploy target */ protected Prim deploy(Prim parent) - throws SmartFrogDeploymentException { + throws SmartFrogDeploymentException { + String processName = "unknown"; try { ProcessCompound pc = null; try { pc = getProcessCompound(); } catch (Exception e) { - throw (SmartFrogDeploymentException)SmartFrogDeploymentException.forward(e); + throw (SmartFrogDeploymentException) SmartFrogDeploymentException.forward(e); } ProcessCompound local = SFProcess.getProcessCompound(); - + processName = pc.sfProcessName(); if (pc.equals(local)) { if (parent == null) { return local.sfDeployComponentDescription(null, parent, target, @@ -140,9 +142,12 @@ } else { return pc.sfDeployComponentDescription(null, parent, target, null); } - }catch (Exception ex){ - // if (sflog.isErrorEnabled()) sflog.error(ex); // don't log errors here - throw (SmartFrogDeploymentException)SmartFrogDeploymentException.forward("PrimHostDeployerImpl.deploy",ex); + } catch (ConnectException ex) { + throw (SmartFrogDeploymentException) SmartFrogDeploymentException + .forward("PrimHostDeployerImpl.deploy failed to connect to " + processName, ex); + } catch (Exception ex) { + throw (SmartFrogDeploymentException) SmartFrogDeploymentException + .forward("PrimHostDeployerImpl.deploy failed to deploy to " + processName, ex); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <st...@us...> - 2010-10-13 16:18:43
|
Revision: 8416 http://smartfrog.svn.sourceforge.net/smartfrog/?rev=8416&view=rev Author: steve_l Date: 2010-10-13 16:18:37 +0000 (Wed, 13 Oct 2010) Log Message: ----------- SFOS-1538 Have PrimHostDeployer be slightly more helpful on failures Modified Paths: -------------- trunk/core/smartfrog/src/org/smartfrog/sfcore/processcompound/PrimHostDeployerImpl.java Modified: trunk/core/smartfrog/src/org/smartfrog/sfcore/processcompound/PrimHostDeployerImpl.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/sfcore/processcompound/PrimHostDeployerImpl.java 2010-10-12 14:12:51 UTC (rev 8415) +++ trunk/core/smartfrog/src/org/smartfrog/sfcore/processcompound/PrimHostDeployerImpl.java 2010-10-13 16:18:37 UTC (rev 8416) @@ -120,7 +120,7 @@ */ protected Prim deploy(Prim parent) throws SmartFrogDeploymentException { - String processName = "unknown"; + String processName = "(unknown process)"; try { ProcessCompound pc = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <st...@us...> - 2011-03-21 11:09:14
|
Revision: 8550 http://smartfrog.svn.sourceforge.net/smartfrog/?rev=8550&view=rev Author: steve_l Date: 2011-03-21 11:09:07 +0000 (Mon, 21 Mar 2011) Log Message: ----------- SFOS-1574 Improve diagnostics on connect failure Modified Paths: -------------- trunk/core/smartfrog/src/org/smartfrog/sfcore/processcompound/PrimHostDeployerImpl.java Modified: trunk/core/smartfrog/src/org/smartfrog/sfcore/processcompound/PrimHostDeployerImpl.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/sfcore/processcompound/PrimHostDeployerImpl.java 2011-03-18 17:58:53 UTC (rev 8549) +++ trunk/core/smartfrog/src/org/smartfrog/sfcore/processcompound/PrimHostDeployerImpl.java 2011-03-21 11:09:07 UTC (rev 8550) @@ -45,7 +45,9 @@ */ public class PrimHostDeployerImpl extends PrimDeployerImpl { - /** ProcessLog. This log is used to log into the core log: SF_CORE_LOG */ + /** ProcessLog. This log is used to log into the core log: SF_CORE_LOG + * Although unused, it forces the logging to be set up, so must not be removed + * */ private LogSF sflog = LogFactory.sfGetProcessLog(); /** Efficiency holder of sfProcessHost attribute. */ @@ -120,34 +122,42 @@ */ protected Prim deploy(Prim parent) throws SmartFrogDeploymentException { - String processName = "(unknown process)"; + String targetProcessName = "(unknown process)"; + ProcessCompound targetProcess = null; + ProcessCompound local; + String stage= ""; try { - ProcessCompound pc = null; - - try { - pc = getProcessCompound(); - } catch (Exception e) { - throw (SmartFrogDeploymentException) SmartFrogDeploymentException.forward(e); - } - - ProcessCompound local = SFProcess.getProcessCompound(); - processName = pc.sfProcessName(); - if (pc.equals(local)) { + stage = "retrieving local process compound"; + local = SFProcess.getProcessCompound(); + stage = "retrieving target process compound"; + targetProcess = getProcessCompound(); + targetProcessName = targetProcess.toString(); + stage = "determining process name of target process " + targetProcessName; + targetProcessName = targetProcess.sfProcessName() + " [" + targetProcess.toString() + "]"; + if (targetProcess.equals(local)) { + targetProcessName = "local process "+ targetProcessName; if (parent == null) { - return local.sfDeployComponentDescription(null, parent, target, - null); + stage ="deploying to the root of the local process"; + return local.sfDeployComponentDescription(null, null, target, null); } else { + stage = "deploying under the parent node"; return super.deploy(parent); } } else { - return pc.sfDeployComponentDescription(null, parent, target, null); + stage = "deploying remotely to " + targetProcessName; + return targetProcess.sfDeployComponentDescription(null, parent, target, null); } } catch (ConnectException ex) { + //failure throw (SmartFrogDeploymentException) SmartFrogDeploymentException - .forward("PrimHostDeployerImpl.deploy failed to connect to " + processName, ex); + .forward("PrimHostDeployerImpl.deploy failed to connect to " + targetProcessName + + " while " + stage, + ex); } catch (Exception ex) { throw (SmartFrogDeploymentException) SmartFrogDeploymentException - .forward("PrimHostDeployerImpl.deploy failed to deploy to " + processName, ex); + .forward("PrimHostDeployerImpl.deploy failed to deploy to " + targetProcessName + + " while " + stage, + ex); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |