te')); return $arr; } /* 遍历用户所有主题 * @param $uid 用户ID * @param int $page 页数 * @param int $pagesize 每页记录条数 * @param bool $desc 排序方式 TRUE降序 FALSE升序 * @param string $key 返回的数组用那一列的值作为 key * @param array $col 查询哪些列 */ function thread_tid_find_by_uid($uid, $page = 1, $pagesize = 1000, $desc = TRUE, $key = 'tid', $col = array()) { if (empty($uid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('uid' => $uid), array('tid' => $orderby), $page, $pagesize, $key, $col); return $arr; } // 遍历栏目下tid 支持数组 $fid = array(1,2,3) function thread_tid_find_by_fid($fid, $page = 1, $pagesize = 1000, $desc = TRUE) { if (empty($fid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('fid' => $fid), array('tid' => $orderby), $page, $pagesize, 'tid', array('tid', 'verify_date')); return $arr; } function thread_tid_delete($tid) { if (empty($tid)) return FALSE; $r = thread_tid__delete(array('tid' => $tid)); return $r; } function thread_tid_count() { $n = thread_tid__count(); return $n; } // 统计用户主题数 大数量下严谨使用非主键统计 function thread_uid_count($uid) { $n = thread_tid__count(array('uid' => $uid)); return $n; } // 统计栏目主题数 大数量下严谨使用非主键统计 function thread_fid_count($fid) { $n = thread_tid__count(array('fid' => $fid)); return $n; } ?>spring boot - Springboot application starts and builds in intellij but does not build when i do mvn clean install - Stack Overfl
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

spring boot - Springboot application starts and builds in intellij but does not build when i do mvn clean install - Stack Overfl

programmeradmin1浏览0评论

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

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论