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.

This commit is contained in:
Claus Ibsen 2013-11-03 13:40:38 +01:00 committed by Hadrian Zbarcea
parent c1fc98a05a
commit 0b21daf5a3

View File

@ -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;
}