activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
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.
Date Wed, 12 Mar 2014 14:13:10 GMT
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 <claus.ibsen@gmail.com>
Authored: Sun Nov 3 13:40:38 2013 +0100
Committer: Hadrian Zbarcea <hadrian@apache.org>
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;
     }
 


Mime
View raw message