geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r487158 - in /geronimo/server: branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/ branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/ branches/2.0-M1/modules/geronimo-system/src/main/ja...
Date Thu, 14 Dec 2006 10:12:34 GMT
Author: vamsic007
Date: Thu Dec 14 02:12:33 2006
New Revision: 487158

URL: http://svn.apache.org/viewvc?view=rev&rev=487158
Log:
GERONIMO-2551 Plugin hits NPE if maven-metadata listed artifact doesn't exist or JAR artifact
maven-metadata doesn't exist
  o Applied the patch provided by Donald Woods.  Thanks Donald!
  o Check for null file handle, PluginMetadata and log appropriate messages.

Modified:
    geronimo/server/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
    geronimo/server/branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
    geronimo/server/branches/2.0-M1/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java

Modified: geronimo/server/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?view=diff&rev=487158&r1=487157&r2=487158
==============================================================================
--- geronimo/server/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
(original)
+++ geronimo/server/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
Thu Dec 14 02:12:33 2006
@@ -676,6 +676,10 @@
             OpenResult result = openStream(configID, repos, username, password, monitor);
             try {
                 File tempFile = downloadFile(result, monitor);
+                if (tempFile == null) {
+                    log.error("Null filehandle was returned for "+configID);
+                    throw new IllegalArgumentException("Null filehandle was returned for
"+configID);
+                }
                 PluginMetadata pluginData = ((PluginMetadata) metadata.get(configID));
                 // Only bother with the hash if we got it from a source other than the download
file itself
                 PluginMetadata.Hash hash = pluginData == null ? null : pluginData.getHash();
@@ -702,7 +706,10 @@
                     log.warn("Unable to delete temporary download file "+tempFile.getAbsolutePath());
                     tempFile.deleteOnExit();
                 }
-                installConfigXMLData(result.getConfigID(), pluginData);
+                if (pluginData != null)
+                    installConfigXMLData(result.getConfigID(), pluginData);
+                else
+                    log.debug("No config XML data to install.");
                 if(dependency) {
                     monitor.getResults().addDependencyInstalled(configID);
                     configID = result.getConfigID();

Modified: geronimo/server/branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?view=diff&rev=487158&r1=487157&r2=487158
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
(original)
+++ geronimo/server/branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
Thu Dec 14 02:12:33 2006
@@ -676,6 +676,10 @@
             OpenResult result = openStream(configID, repos, username, password, monitor);
             try {
                 File tempFile = downloadFile(result, monitor);
+                if (tempFile == null) {
+                    log.error("Null filehandle was returned for "+configID);
+                    throw new IllegalArgumentException("Null filehandle was returned for
"+configID);
+                }
                 PluginMetadata pluginData = ((PluginMetadata) metadata.get(configID));
                 // Only bother with the hash if we got it from a source other than the download
file itself
                 PluginMetadata.Hash hash = pluginData == null ? null : pluginData.getHash();
@@ -702,7 +706,10 @@
                     log.warn("Unable to delete temporary download file "+tempFile.getAbsolutePath());
                     tempFile.deleteOnExit();
                 }
-                installConfigXMLData(result.getConfigID(), pluginData);
+                if (pluginData != null)
+                    installConfigXMLData(result.getConfigID(), pluginData);
+                else
+                    log.debug("No config XML data to install.");
                 if(dependency) {
                     monitor.getResults().addDependencyInstalled(configID);
                     configID = result.getConfigID();

Modified: geronimo/server/branches/2.0-M1/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0-M1/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?view=diff&rev=487158&r1=487157&r2=487158
==============================================================================
--- geronimo/server/branches/2.0-M1/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
(original)
+++ geronimo/server/branches/2.0-M1/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
Thu Dec 14 02:12:33 2006
@@ -676,6 +676,10 @@
             OpenResult result = openStream(configID, repos, username, password, monitor);
             try {
                 File tempFile = downloadFile(result, monitor);
+                if (tempFile == null) {
+                    log.error("Null filehandle was returned for "+configID);
+                    throw new IllegalArgumentException("Null filehandle was returned for
"+configID);
+                }
                 PluginMetadata pluginData = ((PluginMetadata) metadata.get(configID));
                 // Only bother with the hash if we got it from a source other than the download
file itself
                 PluginMetadata.Hash hash = pluginData == null ? null : pluginData.getHash();
@@ -702,7 +706,10 @@
                     log.warn("Unable to delete temporary download file "+tempFile.getAbsolutePath());
                     tempFile.deleteOnExit();
                 }
-                installConfigXMLData(result.getConfigID(), pluginData);
+                if (pluginData != null)
+                    installConfigXMLData(result.getConfigID(), pluginData);
+                else
+                    log.debug("No config XML data to install.");
                 if(dependency) {
                     monitor.getResults().addDependencyInstalled(configID);
                     configID = result.getConfigID();

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?view=diff&rev=487158&r1=487157&r2=487158
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
(original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
Thu Dec 14 02:12:33 2006
@@ -676,6 +676,10 @@
             OpenResult result = openStream(configID, repos, username, password, monitor);
             try {
                 File tempFile = downloadFile(result, monitor);
+                if (tempFile == null) {
+                    log.error("Null filehandle was returned for "+configID);
+                    throw new IllegalArgumentException("Null filehandle was returned for
"+configID);
+                }
                 PluginMetadata pluginData = ((PluginMetadata) metadata.get(configID));
                 // Only bother with the hash if we got it from a source other than the download
file itself
                 PluginMetadata.Hash hash = pluginData == null ? null : pluginData.getHash();
@@ -702,7 +706,10 @@
                     log.warn("Unable to delete temporary download file "+tempFile.getAbsolutePath());
                     tempFile.deleteOnExit();
                 }
-                installConfigXMLData(result.getConfigID(), pluginData);
+                if (pluginData != null)
+                    installConfigXMLData(result.getConfigID(), pluginData);
+                else
+                    log.debug("No config XML data to install.");
                 if(dependency) {
                     monitor.getResults().addDependencyInstalled(configID);
                     configID = result.getConfigID();



Mime
View raw message