mirror of https://github.com/apache/activemq.git
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:
parent
d0f48b3ee5
commit
4ddbb8546d
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue