geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r921198 - in /geronimo/server/trunk/framework/modules: geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/ geronimo-main/src/main/java/org/apache/geronimo/mai...
Date Wed, 10 Mar 2010 00:44:54 GMT
Author: djencks
Date: Wed Mar 10 00:44:54 2010
New Revision: 921198

URL: http://svn.apache.org/viewvc?rev=921198&view=rev
Log:
add some toString methods and some logging to help figure out what happens during deployment

Modified:
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java
    geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Utils.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/CommandLine.java

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java?rev=921198&r1=921197&r2=921198&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java
Wed Mar 10 00:44:54 2010
@@ -314,4 +314,16 @@ public class ConfigurationData implement
         this.useEnvironment = useEnvironment;
     }
 
+
+    @Override
+    public String toString() {
+        StringBuilder buf = new StringBuilder("ConfigurationData [");
+        buf.append("\n  Environment: ").append(environment);
+        buf.append("\n  ConfigurationDir: ").append(getConfigurationDir());
+        buf.append("\n  autoStart: ").append(isAutoStart());
+        for (Map.Entry<String, ConfigurationData> entry: getChildConfigurations().entrySet())
{
+            buf.append("\n  Child at: ").append(entry.getKey()).append(entry.getValue());
+        }
+        return buf.toString();
+    }
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java?rev=921198&r1=921197&r2=921198&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java
Wed Mar 10 00:44:54 2010
@@ -206,4 +206,12 @@ public class Environment implements Seri
         return manifest;
     }
 
+
+    @Override
+    public String toString() {
+        StringBuilder buf = new StringBuilder("Environment [");
+        buf.append("\n  Id: ").append(getConfigId());
+        buf.append("]\n");
+        return buf.toString();
+    }
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Utils.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Utils.java?rev=921198&r1=921197&r2=921198&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Utils.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Utils.java
Wed Mar 10 00:44:54 2010
@@ -125,7 +125,7 @@ public class Utils {
             throw new IllegalArgumentException(errPrefix + " '" + path + "' : " + e.getMessage());
         }
         if (!rc.exists()) {
-            throw new IllegalArgumentException(errPrefix + " '" + path + "' : does not exist");
+            throw new IllegalArgumentException(errPrefix + " '" + rc + "' " + " derived from:
'" + path + "' : does not exist");
         }
         if (!rc.isDirectory()) {
             throw new IllegalArgumentException(errPrefix + " '" + path + "' : is not a directory");

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java?rev=921198&r1=921197&r2=921198&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
Wed Mar 10 00:44:54 2010
@@ -46,11 +46,15 @@ import org.apache.geronimo.gbean.GBeanDa
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GAttributeInfo;
 import org.apache.geronimo.gbean.GReferenceInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @version $Rev$ $Date$
  */
 public final class ExecutableConfigurationUtil {
+    private static final Logger log = LoggerFactory.getLogger(ExecutableConfigurationUtil.class);
+
     private static final String META_INF = "META-INF";
     private static final String CONFIG_SER = "config.ser";
     private static final String CONFIG_INFO = "config.info";
@@ -68,6 +72,7 @@ public final class ExecutableConfigurati
     }
 
     public static void createExecutableConfiguration(ConfigurationData configurationData,
Manifest manifest, File destinationFile) throws IOException {
+        log.debug("createExecutableConfiguration: id: {} destination: {}", configurationData.getId(),
destinationFile.getAbsolutePath());
         File configurationDir = configurationData.getConfigurationDir();
         
         // ensure parent directories have been created
@@ -166,6 +171,7 @@ public final class ExecutableConfigurati
     }
 
     public static void writeConfiguration(ConfigurationData configurationData, File source)
throws IOException {
+        log.debug("writeConfiguration: id: {} source: {}", configurationData.getId(), source.getAbsolutePath());
         // save the persisted form in the source directory
         File metaInf = new File(source, META_INF);
         metaInf.mkdirs();

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java?rev=921198&r1=921197&r2=921198&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
Wed Mar 10 00:44:54 2010
@@ -319,6 +319,7 @@ public class RepositoryConfigurationStor
 
     public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException
{
         // determine the source file/dir
+        log.debug("Writing config: " + configurationData);
         File source = configurationData.getConfigurationDir();
         if (!source.exists()) {
             throw new InvalidConfigException("Source does not exist " + source);
@@ -334,10 +335,14 @@ public class RepositoryConfigurationStor
         File destination = repository.getLocation(configId);
         if (!source.equals(destination)) {
             if (source.isFile()) {
+                log.debug("copying packed bundle from " + source + " to destination " + destination);
                 repository.copyToRepository(source, configId, null);
             } else {
+                log.debug("Packing bundle from " + source + " to destination " + destination);
                 JarUtils.jarDirectory(source, destination);
             }
+        } else {
+            log.debug("Plugin is already in location " + source);
         }
         // if directory in the correct place -- noop
        /*

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/CommandLine.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/CommandLine.java?rev=921198&r1=921197&r2=921198&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/CommandLine.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/CommandLine.java
Wed Mar 10 00:44:54 2010
@@ -22,6 +22,7 @@ import java.io.InputStream;
 import java.net.URL;
 import java.util.Collection;
 import java.util.Enumeration;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Set;
 
@@ -94,7 +95,13 @@ public class CommandLine {
     protected void doInvokeMainGBean(AbstractNameQuery mainGBeanQuery, String mainMethod,
String[] args) throws Exception {
         Set matches = kernel.listGBeans(mainGBeanQuery);
         if (matches.isEmpty()) {
-            throw new Exception("No match for AbstractNameQuery: " + mainGBeanQuery);
+            matches = kernel.listGBeans((AbstractNameQuery)null);
+            StringBuilder b = new StringBuilder("No match for AbstractNameQuery: ").append(mainGBeanQuery);
+            b.append("\n  artifactId: ").append(mainGBeanQuery.getArtifact());
+            for (Object o: matches) {
+                b.append("\n ").append(o);
+            }
+            throw new Exception(b.toString());
         }
         if (matches.size() > 1) {
             throw new Exception("Ambiguous AbstractNameQuery: " + mainGBeanQuery + " matches:
" + matches);



Mime
View raw message