Return-Path: Delivered-To: apmail-felix-commits-archive@www.apache.org Received: (qmail 31574 invoked from network); 16 Jan 2008 19:39:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Jan 2008 19:39:51 -0000 Received: (qmail 951 invoked by uid 500); 16 Jan 2008 19:39:40 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 928 invoked by uid 500); 16 Jan 2008 19:39:40 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 914 invoked by uid 99); 16 Jan 2008 19:39:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jan 2008 11:39:40 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED 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; Wed, 16 Jan 2008 19:39:24 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9C0B41A9832; Wed, 16 Jan 2008 11:39:29 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r612553 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Date: Wed, 16 Jan 2008 19:39:28 -0000 To: commits@felix.apache.org From: pauls@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080116193929.9C0B41A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: pauls Date: Wed Jan 16 11:39:23 2008 New Revision: 612553 URL: http://svn.apache.org/viewvc?rev=612553&view=rev Log: Fix a NPE on framework restart when extension bundles are installed. Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java?rev=612553&r1=612552&r2=612553&view=diff ============================================================================== --- felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java (original) +++ felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Wed Jan 16 11:39:23 2008 @@ -712,6 +712,22 @@ archives = null; } + // create the system bundle that is responsible for providing specific + // container related services. + IContentLoader cl = m_extensionManager; + cl.setSearchPolicy( + new R4SearchPolicy( + m_policyCore, m_systemBundleInfo.getCurrentModule())); + m_factory.setContentLoader( + m_systemBundleInfo.getCurrentModule(), + cl); + m_factory.setSecurityContext( + m_systemBundleInfo.getCurrentModule(), + getClass().getProtectionDomain()); + + m_installedBundleMap.put( + m_systemBundleInfo.getLocation(), this); + FelixBundle bundle = null; // Now install all cached bundles. @@ -784,25 +800,10 @@ } } - // Now that the cached bundles are reloaded, create the system - // bundle that is responsible for providing specific container - // related services and activating all custom framework activators. + // Now that the cached bundles are reloaded, + // activating all custom framework activators. try { - IContentLoader cl = m_extensionManager; - cl.setSearchPolicy( - new R4SearchPolicy( - m_policyCore, m_systemBundleInfo.getCurrentModule())); - m_factory.setContentLoader( - m_systemBundleInfo.getCurrentModule(), - cl); - m_factory.setSecurityContext( - m_systemBundleInfo.getCurrentModule(), - getClass().getProtectionDomain()); - - m_installedBundleMap.put( - m_systemBundleInfo.getLocation(), this); - // Manually resolve the System Bundle, which will cause its // state to be set to RESOLVED. try @@ -822,8 +823,10 @@ // Create the bundle context for the system bundle and // then activate it. - m_systemBundleInfo.setBundleContext(new BundleContextImpl(m_logger, this, this)); - Felix.m_secureAction.startActivator(m_systemBundleInfo.getActivator(), m_systemBundleInfo.getBundleContext()); + m_systemBundleInfo.setBundleContext( + new BundleContextImpl(m_logger, this, this)); + Felix.m_secureAction.startActivator(m_systemBundleInfo.getActivator(), + m_systemBundleInfo.getBundleContext()); } catch (Throwable ex) { @@ -843,7 +846,8 @@ try { StartLevel sl = (StartLevel) getService( - getBundle(0),getServiceReferences((FelixBundle) getBundle(0), StartLevel.class.getName(), null, true)[0]); + getBundle(0),getServiceReferences((FelixBundle) getBundle(0), + StartLevel.class.getName(), null, true)[0]); if (sl instanceof StartLevelImpl) { ((StartLevelImpl) sl).setStartLevelAndWait(startLevel);