Return-Path: X-Original-To: apmail-geronimo-scm-archive@www.apache.org Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EEE75419A for ; Wed, 29 Jun 2011 07:16:38 +0000 (UTC) Received: (qmail 35507 invoked by uid 500); 29 Jun 2011 07:16:37 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 35347 invoked by uid 500); 29 Jun 2011 07:16:20 -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 35324 invoked by uid 99); 29 Jun 2011 07:16:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2011 07:16:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2011 07:16:15 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C3F23238885D; Wed, 29 Jun 2011 07:15:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1140982 - /geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java Date: Wed, 29 Jun 2011 07:15:55 -0000 To: scm@geronimo.apache.org From: chirunhua@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110629071555.C3F23238885D@eris.apache.org> Author: chirunhua Date: Wed Jun 29 07:15:55 2011 New Revision: 1140982 URL: http://svn.apache.org/viewvc?rev=1140982&view=rev Log: GERONIMO-6010:NPE when creating keystores Modified: geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java Modified: geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java?rev=1140982&r1=1140981&r2=1140982&view=diff ============================================================================== --- geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java (original) +++ geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java Wed Jun 29 07:15:55 2011 @@ -55,6 +55,9 @@ import org.apache.geronimo.gbean.GBeanIn import org.apache.geronimo.gbean.GBeanInfoBuilder; import org.apache.geronimo.gbean.GBeanLifecycle; import org.apache.geronimo.kernel.Kernel; +import org.apache.geronimo.kernel.config.ConfigurationUtil; +import org.apache.geronimo.kernel.config.EditableConfigurationManager; +import org.apache.geronimo.kernel.config.InvalidConfigException; import org.apache.geronimo.kernel.util.InputUtils; import org.apache.geronimo.management.geronimo.KeyIsLocked; import org.apache.geronimo.management.geronimo.KeystoreException; @@ -178,21 +181,21 @@ public class FileKeystoreManager impleme } } data.setAttribute("keystoreType", type); -// EditableConfigurationManager mgr = ConfigurationUtil.getEditableConfigurationManager(kernel); -// if(mgr != null) { -// try { -// mgr.addGBeanToConfiguration(myName.getArtifact(), data, true); -// return (KeystoreInstance) kernel.getProxyManager().createProxy(aName, KeystoreInstance.class); -// } catch (InvalidConfigException e) { -// log.error("Should never happen", e); -// throw new IllegalStateException("Unable to add Keystore GBean ("+e.getMessage()+")", e); -// } finally { -// ConfigurationUtil.releaseConfigurationManager(kernel, mgr); -// } -// } else { + EditableConfigurationManager mgr = ConfigurationUtil.getEditableConfigurationManager(kernel); + if(mgr != null) { + try { + mgr.addGBeanToConfiguration(myName.getArtifact(), data, true); + return (KeystoreInstance) kernel.getProxyManager().createProxy(aName, KeystoreInstance.class); + } catch (InvalidConfigException e) { + log.error("Should never happen", e); + throw new IllegalStateException("Unable to add Keystore GBean ("+e.getMessage()+")", e); + } finally { + ConfigurationUtil.releaseConfigurationManager(kernel, mgr); + } + } else { log.warn("The ConfigurationManager in the kernel does not allow changes at runtime"); return null; -// } + } } /**