Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 57411 invoked from network); 14 Dec 2006 10:13:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Dec 2006 10:13:21 -0000 Received: (qmail 45571 invoked by uid 500); 14 Dec 2006 10:13:29 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 45549 invoked by uid 500); 14 Dec 2006 10:13:28 -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 45538 invoked by uid 99); 14 Dec 2006 10:13:28 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Dec 2006 02:13:28 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,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, 14 Dec 2006 02:13:20 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id C28EC1A981D; Thu, 14 Dec 2006 02:12:34 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: scm@geronimo.apache.org From: vamsic007@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061214101234.C28EC1A981D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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();