Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8229410AE1 for ; Wed, 12 Mar 2014 14:13:16 +0000 (UTC) Received: (qmail 95926 invoked by uid 500); 12 Mar 2014 14:13:15 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 95784 invoked by uid 500); 12 Mar 2014 14:13:14 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 95668 invoked by uid 99); 12 Mar 2014 14:13:10 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Mar 2014 14:13:10 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 3F966941C9F; Wed, 12 Mar 2014 14:13:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hadrian@apache.org To: commits@activemq.apache.org Date: Wed, 12 Mar 2014 14:13:10 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [01/13] git commit: AMQ-2960: Fixed potential NPE in pooled connection factory in activemq-spring when using spring-dm in OSGi. As spring-dm may call getObject before postCostruct has been called. Repository: activemq Updated Branches: refs/heads/activemq-5.9 c1fc98a05 -> 6ef202e02 AMQ-2960: Fixed potential NPE in pooled connection factory in activemq-spring when using spring-dm in OSGi. As spring-dm may call getObject before postCostruct has been called. Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/0b21daf5 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/0b21daf5 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/0b21daf5 Branch: refs/heads/activemq-5.9 Commit: 0b21daf5a30d8ed97d4467a78118d818ed6a3bd6 Parents: c1fc98a Author: Claus Ibsen Authored: Sun Nov 3 13:40:38 2013 +0100 Committer: Hadrian Zbarcea Committed: Wed Mar 12 08:59:26 2014 -0400 ---------------------------------------------------------------------- .../org/apache/activemq/pool/PooledConnectionFactoryBean.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/0b21daf5/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java ---------------------------------------------------------------------- diff --git a/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java b/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java index afd380f..6a9de11 100644 --- a/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java +++ b/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java @@ -185,9 +185,12 @@ public class PooledConnectionFactoryBean implements FactoryBean { } } - // FactoryBean methods @Override public Object getObject() throws Exception { + // in case spring-dm calls getObject before this bean has been initialized + if (pooledConnectionFactory == null) { + afterPropertiesSet(); + } return pooledConnectionFactory; }