spring boot 2.0整合activemq時遇到的錯誤
阿新 • • 發佈:2018-12-22
雖然我在網上看到別人都是這麼寫的,也成功了。
但是我卻老是報錯,報注入jmsTemplate失敗,我就決定手動註冊jmsTemplate,發現我下的maven包裡竟然沒有ActiveMQConnectionFactory這個類。
於是,我只能新增apache包。
這是最後的maven依賴。
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.0.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-activemq</artifactId> </dependency> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-pool</artifactId> </dependency> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-all</artifactId> <version>5.11.2</version> </dependency> </dependencies>
整了我好久