消息模块后端启动报错,是少了什么注解嘛
来源:9-12 执行系统消息异步收发(一)

Roem
2022-03-14
Field mongoTemplate in com.example.emos.wx.db.dao.MessageDao required a bean of type 'org.springframework.data.mongodb.core.MongoTemplate' that could not be found.
WARN Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'messageTask': Unsatisfied dependency expressed through field 'messageService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'messageServiceImpl': Unsatisfied dependency expressed through field 'messageDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'messageDao': Unsatisfied dependency expressed through field 'mongoTemplate'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.data.mongodb.core.MongoTemplate' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
1回答
-
神思者
2022-03-14
你的mongodb配置的不对,检查yml文件和dao的注解
012022-03-14
相似问题