admin管理员组文章数量:1244315
I am building a simple application try the Artemis ActiveMQ embedded server with springboot.
Now in IntelliJ I am able to click on maven clean install and it runs fine. I am also able to start the application with no issues when i run it by running the ManagementApplication which is annotated with the @SpringBoot
annotation.
But the problem occurs when I use the commands mvn clean install
or mvn spring-boot:run
the terminal (intellij terminal or any terminal).
The tests CreateGroupListenerTest and DeleteGroupListenerTest both fail with the following error. The embedded server does not seem to be starting before the message is sent using jmsTemplate.send
. When I run the tests in Intellij they work fine. The only problem is with
I tried a multiple of things like creating a separate application.properties in test/resources directory and adding the following :
spring.artemis.embedded.enabled=true
spring.artemis.embedded.queues=group.events.queue
spring.artemis.embedded.persistent=false
logging.level.apache.activemq.artemis=DEBUG
logging.level.springframework.jms=DEBUG
# Disable the native libaio requirement
artemis.native.lib=false
But it does not work. I want to really run it using mvn spring-boot:run
. How do i get that working ?
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.228 s <<< FAILURE! -- in com.hospital.management.consumer.DeleteGroupListenerTest [ERROR] com.hospital.management.consumer.DeleteGroupListenerTest.testReceiveDeleteMessage
-- Time elapsed: 0.003 s <<< ERROR! .springframework.jms.UncategorizedJmsException: Uncategorized exception occurred during JMS processing; nested exception is ActiveMQNotConnectedException[errorType=NOT_CONNECTED message=AMQ219007: Cannot connect to server(s). Tried with all available servers.]
at .springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:309)
at .springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:199)
at .springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:533)
at .springframework.jms.core.JmsTemplate.send(JmsTemplate.java:610)
at com.hospital.management.consumer.DeleteGroupListenerTest.testReceiveDeleteMessage(DeleteGroupListenerTest.java:50)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597) Caused by: jakarta.jms.JMSException: Failed to create session factory
at .apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:912)
at .apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:311)
at .apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:306)
at .springframework.jms.connection.SingleConnectionFactory.doCreateConnection(SingleConnectionFactory.java:475)
at .springframework.jms.connection.SingleConnectionFactory.initConnection(SingleConnectionFactory.java:434)
at .springframework.jms.connection.SingleConnectionFactory.getConnection(SingleConnectionFactory.java:340)
at .springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:245)
at .springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:211)
at .springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:517)
... 5 more Caused by: ActiveMQNotConnectedException[errorType=NOT_CONNECTED message=AMQ219007: Cannot connect to server(s). Tried with all available servers.]
at .apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:729)
at .apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:910)
... 13 more
本文标签:
版权声明:本文标题:spring boot - Springboot application starts and builds in intellij but does not build when i do mvn clean install - Stack Overfl 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740124818a2228656.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论