springboot+activemq 시작 보고서 의 오 류 를 해결 합 니 다.
4958 단어 springbootactivemq주해
Description:
Field jmsMessagingTemplate in com.haozz.demo.mq.PromoteActProducer required a bean of type 'org.springframework.jms.core.JmsMessagingTemplate' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
The following candidates were found but could not be injected:
- Bean method 'jmsMessagingTemplate' in 'JmsAutoConfiguration.MessagingTemplateConfiguration' not loaded because Ancestor org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration did not match
Action:
Consider revisiting the entries above or defining a bean of type 'org.springframework.jms.core.JmsMessagingTemplate' in your configuration.
원인 총 결 에는 다음 과 같은 세 가지 이유 가 있다.
1.spring.activemq.pool.enabled=true,스 레 드 탱크 가 열 리 고 뒤에 빈 칸 이 있 으 며 스 레 드 탱크 가방 을 도입 하지 않 았 습 니 다.
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-pool</artifactId>
</dependency>2.springboot 버 전 문 제 는 지원 되 지 않 습 니 다.2.0 버 전 으로 시작 하 는 것 을 권장 합 니 다.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>추측:2.1.0+버 전 은 자신의 스 레 드 탱크 관리 가 있어 충돌 한 것 으로 추정 된다.3.spring.activemq.pool.enabled=false,스 레 드 풀 닫 기
springboot 통합 activemq 구덩이 밟 기
시작 할 때 꺼졌어 요.
설정 은 다음 과 같 습 니 다.
server:
port: 8762
# context-path: /memeber
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/
spring:
application:
name: member
redis:
host: 127.0.0.1
password: 123456
port: 6379
pool:
max-idle: 100
min-idle: 1
max-active: 1000
max-wait: -1
datasource:
name: test1
url: jdbc:mysql://127.0.0.1:3306/dandan-member
username: root
password: 123456
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
filters: stat
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
##activemq
activemq:
broker-url: tcp://localhost:61616
in-memory: true
pool:
enabled: false
##
messages:
queue: messages_queue
해결 은 다음 과 같다.원래 activemq 는 spring 에 없 었 습 니 다.바로 앞 에 있 었 습 니 다.spring 과 동급 입 니 다.
해결 후 설정 은 다음 과 같 습 니 다.
server:
port: 8762
# context-path: /memeber
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/
spring:
application:
name: member
redis:
host: 127.0.0.1
password: 123456
port: 6379
pool:
max-idle: 100
min-idle: 1
max-active: 1000
max-wait: -1
datasource:
name: test1
url: jdbc:mysql://127.0.0.1:3306/dandan-member
username: root
password: 123456
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
filters: stat
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
##activemq
activemq:
broker-url: tcp://localhost:61616
in-memory: true
pool:
enabled: false
##
messages:
queue: messages_queue
건의yml 들 여 쓰기 에는 네 개의 바이트 가 필요 합 니 다.한 바이트 로 는 구별 하기 어렵다.이상 은 개인 적 인 경험 이 므 로 여러분 에 게 참고 가 되 기 를 바 랍 니 다.여러분 들 도 저 희 를 많이 응원 해 주시 기 바 랍 니 다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Kotlin Springboot -- 파트 14 사용 사례 REST로 전환하여 POST로 JSON으로 전환前回 前回 前回 記事 の は は で で で で で で を 使っ 使っ 使っ て て て て て リクエスト を を 受け取り 、 reqeustbody で 、 その リクエスト の ボディ ボディ を を 受け取り 、 関数 内部 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.