SpringBoot启动总是报这个创建bean失败是什么原因啊,在网上找了很多处理方法总是解决不了,求助!!!

来源:4-1 买家类目-dao(上)

慕婉清2485985

2019-12-16

2019-12-16 16:42:46,443 - Starting Servlet Engine: Apache Tomcat/9.0.13
2019-12-16 16:42:46,502 - The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [D:\java\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;E:\程序\xshell6_02\;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\java\bin;D:\edit\maven-3.1.0\bin;D:\edit\oracle\app\oracle\product\instantclient_12_1;D:\edit\mysql\mysql-8.0.12-winx64\bin\bin;D:\edit\SVN\bin;D:\java/bin;C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin;C:\Program Files\Git\cmd;D:\java\bin;D:\edit\oracle\app\oracle\product\instantclient_12_1;D:\edit\maven-3.1.0\bin;.]
2019-12-16 16:42:46,737 - Initializing Spring embedded WebApplicationContext
2019-12-16 16:42:46,737 - Root WebApplicationContext: initialization completed in 2535 ms
2019-12-16 16:42:47,200 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'buyerOrderController': Unsatisfied dependency expressed through field 'orderService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'orderServiceImpl': Unsatisfied dependency expressed through field 'productService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'productServiceImpl': Unsatisfied dependency expressed through field 'repository'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.imooc.repository.ProductInfoRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2019-12-16 16:42:47,222 - Stopping service [Tomcat]
2019-12-16 16:42:47,267 - 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-12-16 16:42:47,456 - 

***************************
APPLICATION FAILED TO START
***************************

Description:

Field repository in com.imooc.service.impl.ProductServiceImpl required a bean of type 'com.imooc.repository.ProductInfoRepository' that could not be found.

The injection point has the following annotations:
	- @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'com.imooc.repository.ProductInfoRepository' in your configuration.

Disconnected from the target VM, address: '127.0.0.1:60248', transport: 'socket'

Process finished with exit code 1
写回答

1回答

扭转乾坤

2019-12-17

com.imooc.repository.ProductInfoRepository

这个写错了

0
0

Spring Boot双版本(1.5/2.1) 打造企业级微信点餐系统

从0到1开发中小型企业级Java应用,并学会迭代重构技巧

6418 学习 · 5257 问题

查看课程