geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r395660 - in /geronimo/branches/1.1/modules: deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/ deploy-tool/src/java/org/apache/geronimo/deployment/cli/ system/src/java/org/apache/geronimo/system/configuration/
Date Thu, 20 Apr 2006 17:48:00 GMT
Author: ammulder
Date: Thu Apr 20 10:47:58 2006
New Revision: 395660

URL: http://svn.apache.org/viewcvs?rev=395660&view=rev
Log:
Unbreak deployment
 - J2EE apps/modules don't disappear (caused by bad check for /car)
 - Deploy actually deploys instead of just distributing (caused
     by in-place change change signatures of an overridden method
     but not the overriding methods)
Minor cleanups suggested by IDEA

Modified:
    geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
    geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDeploy.java
    geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java

Modified: geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java?rev=395660&r1=395659&r2=395660&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
(original)
+++ geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
Thu Apr 20 10:47:58 2006
@@ -53,7 +53,6 @@
                     // Check to see whether the module is already started
                     Artifact moduleID = Artifact.create(module.getModuleID());
                     AbstractName abstractName = Configuration.getConfigurationAbstractName(moduleID);
-                    String objectName = abstractName.getObjectName().getCanonicalName();
                     if (kernel.isRunning(abstractName)) {
                         updateStatus("Module " + moduleID + " is already running");
                         Thread.sleep(100);

Modified: geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDeploy.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDeploy.java?rev=395660&r1=395659&r2=395660&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDeploy.java
(original)
+++ geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDeploy.java
Thu Apr 20 10:47:58 2006
@@ -47,8 +47,8 @@
         return "Deployed";
     }
 
-    protected ProgressObject runCommand(DeploymentManager mgr, PrintWriter out, Target[]
tlist, File module, File plan) throws DeploymentException {
-        ProgressObject po = mgr.distribute(tlist, module, plan);
+    protected ProgressObject runCommand(DeploymentManager mgr, PrintWriter out, boolean inPlace,
Target[] tlist, File module, File plan) throws DeploymentException {
+        ProgressObject po = super.runCommand(mgr, out, inPlace, tlist, module, plan);
         waitForProgress(out, po);
         if(po.getDeploymentStatus().isFailed()) {
             throw new DeploymentException("Unable to distribute "+(module == null ? plan.getName()
: module.getName())+": "+po.getDeploymentStatus().getMessage());

Modified: geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java?rev=395660&r1=395659&r2=395660&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
(original)
+++ geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
Thu Apr 20 10:47:58 2006
@@ -55,7 +55,7 @@
         }
         DeploymentManager mgr = connection.getDeploymentManager();
         Target[] allTargets = mgr.getTargets();
-        TargetModuleID[] allModules = new TargetModuleID[0];
+        TargetModuleID[] allModules;
         try {
             allModules = mgr.getAvailableModules(null, allTargets);
         } catch(TargetException e) {

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java?rev=395660&r1=395659&r2=395660&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
(original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
Thu Apr 20 10:47:58 2006
@@ -48,6 +48,8 @@
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.FileWriteMonitor;
 import org.apache.geronimo.kernel.repository.WritableListableRepository;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * Implementation of ConfigurationStore that loads Configurations from a repository.
@@ -57,6 +59,7 @@
  * @version $Rev: 378459 $ $Date: 2006-02-17 00:37:43 -0800 (Fri, 17 Feb 2006) $
  */
 public class RepositoryConfigurationStore implements ConfigurationStore {
+    private final static Log log = LogFactory.getLog(RepositoryConfigurationStore.class);
     private final Kernel kernel;
     private final ObjectName objectName;
     protected final WritableListableRepository repository;
@@ -70,7 +73,7 @@
         this.kernel = kernel;
         this.objectName = objectName == null ? null : ObjectNameUtil.getObjectName(objectName);
         this.repository = repository;
-        
+
         inPlaceConfUtil = new InPlaceConfigurationUtil();
     }
 
@@ -109,6 +112,9 @@
                 InputStream in = new FileInputStream(serFile);
                 try {
                     configurationData = ConfigurationUtil.readConfigurationData(in);
+                } catch(ClassCastException e) { // Not a ConfigurationData in the file
+                    System.out.println("************ ERROR READING SER FILE "+serFile.getAbsolutePath());
+                    throw e;
                 } finally {
                     IOUtil.close(in);
                 }
@@ -277,7 +283,7 @@
             return false;
         }
     }
-    
+
     public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException
{
         // determine the source file/dir
         File source = configurationData.getConfigurationDir();
@@ -356,12 +362,22 @@
             configs = new ArrayList();
             for (Iterator i = artifacts.iterator(); i.hasNext();) {
                 Artifact configId = (Artifact) i.next();
-                if (configId.getType().equals("car")) {
-                    try {
-                        ConfigurationInfo configurationInfo = loadConfigurationInfo(configId);
-                        configs.add(configurationInfo);
-                    } catch (Exception e) {
-                    }
+                File dir = repository.getLocation(configId);
+                File meta = new File(dir, "META-INF");
+                if(!meta.isDirectory() || !meta.canRead()) {
+                    continue;
+                }
+                File ser = new File(meta, "config.ser");
+                if(!ser.isFile() || !ser.canRead() || ser.length() == 0) {
+                    continue;
+                }
+                try {
+                    ConfigurationInfo configurationInfo = loadConfigurationInfo(configId);
+                    configs.add(configurationInfo);
+                } catch (NoSuchConfigException e) {
+                    log.error("Unexpected error: found META-INF/config.ser for "+configId+"
but couldn't load ConfigurationInfo", e);
+                } catch (IOException e) {
+                    log.error("Unable to load ConfigurationInfo for "+configId, e);
                 }
             }
         }



Mime
View raw message