my application fails on startup with "NoSuchBeanDefinitionException: No bean named 'jmsConnectionFactory' is defined"
This is because the bean is called pooledJmsConnectionFactory, not jmsConnectionFactory when pooled is true. Looks like this is due to bean definitions in ActiveMQConnectionFactoryConfiguration:
@Bean
@ConditionalOnProperty(prefix = "spring.activemq", name = "pooled", havingValue = "false", matchIfMissing = true)
public ActiveMQConnectionFactory jmsConnectionFactory(ActiveMQProperties properties) {
...
@Bean(destroyMethod = "stop")
@ConditionalOnProperty(prefix = "spring.activemq", name = "pooled", havingValue = "true", matchIfMissing = false)
public PooledConnectionFactory pooledJmsConnectionFactory(
One option is of course to set pooled to false.
If setting pooled to true, I can change the expected name by adding the following to application.yml:
I get a NoSuchBeanDefinitionException again because this service obviously also expects a bean named jmsConnectionFactory.
Maybe I can fix this by defining container and adapter as pr chapter 5. But another work-around I found is to add a bean alias to resources.groovy:
When using the example config in chapter 2:
my application fails on startup with "NoSuchBeanDefinitionException: No bean named 'jmsConnectionFactory' is defined" This is because the bean is called
pooledJmsConnectionFactory
, notjmsConnectionFactory
whenpooled
istrue
. Looks like this is due to bean definitions inActiveMQConnectionFactoryConfiguration
:One option is of course to set
pooled
tofalse
. If settingpooled
totrue
, I can change the expected name by adding the following toapplication.yml
:Application is then able to start.
But if I add a service which listens to a topic:
I get a NoSuchBeanDefinitionException again because this service obviously also expects a bean named
jmsConnectionFactory
. Maybe I can fix this by defining container and adapter as pr chapter 5. But another work-around I found is to add a bean alias toresources.groovy
:I'm then able to receive messages from topic. Is there a better way? Should the documentation include some more information on this?