7-5章节 启动项目时报错 是什么原因啊?
来源:7-6 使用sdk方式(下)
vcfriend
2018-04-20
2018-04-20 10:54:02,701 - Starting SellApplication on JERRY with PID 8336 (D:\JavaDev\java\imooc\My\sell\target\classes started by 向亚林 in D:\JavaDev\java\imooc\My\sell) 2018-04-20 10:54:02,705 - No active profile set, falling back to default profiles: default 2018-04-20 10:54:02,781 - Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@3d1848cc: startup date [Fri Apr 20 10:54:02 CST 2018]; root of context hierarchy 2018-04-20 10:54:03,072 - HV000001: Hibernate Validator 5.3.5.Final 2018-04-20 10:54:04,095 - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 2018-04-20 10:54:04,578 - Tomcat initialized with port(s): 8080 (http) 2018-04-20 10:54:04,588 - Starting service Tomcat 2018-04-20 10:54:04,589 - Starting Servlet Engine: Apache Tomcat/8.5.14 2018-04-20 10:54:04,728 - Initializing Spring embedded WebApplicationContext 2018-04-20 10:54:04,728 - Root WebApplicationContext: initialization completed in 1947 ms 2018-04-20 10:54:04,905 - Mapping servlet: 'dispatcherServlet' to [/] 2018-04-20 10:54:04,910 - Mapping filter: 'characterEncodingFilter' to: [/*] 2018-04-20 10:54:04,910 - Mapping filter: 'hiddenHttpMethodFilter' to: [/*] 2018-04-20 10:54:04,910 - Mapping filter: 'httpPutFormContentFilter' to: [/*] 2018-04-20 10:54:04,910 - Mapping filter: 'requestContextFilter' to: [/*] 2018-04-20 10:54:05,403 - Building JPA container EntityManagerFactory for persistence unit 'default' 2018-04-20 10:54:05,414 - HHH000204: Processing PersistenceUnitInfo [ name: default ...] 2018-04-20 10:54:05,476 - HHH000412: Hibernate Core {5.0.12.Final} 2018-04-20 10:54:05,477 - HHH000206: hibernate.properties not found 2018-04-20 10:54:05,479 - HHH000021: Bytecode provider name : javassist 2018-04-20 10:54:05,523 - HCANN000001: Hibernate Commons Annotations {5.0.1.Final} 2018-04-20 10:54:05,656 - HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect 2018-04-20 10:54:06,193 - HHH000228: Running hbm2ddl schema update 2018-04-20 10:54:06,912 - Initialized JPA EntityManagerFactory for persistence unit 'default' 2018-04-20 10:54:07,835 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'payServiceImpl': Unsatisfied dependency expressed through field 'bestPayService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.lly835.bestpay.service.impl.BestPayServiceImpl' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 2018-04-20 10:54:07,836 - Closing JPA EntityManagerFactory for persistence unit 'default' 2018-04-20 10:54:07,839 - Stopping service Tomcat 2018-04-20 10:54:07,849 - Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 2018-04-20 10:54:07,937 - *************************** APPLICATION FAILED TO START *************************** Description: Field bestPayService in com.imooc.sell.service.impl.PayServiceImpl required a bean of type 'com.lly835.bestpay.service.impl.BestPayServiceImpl' that could not be found. Action: Consider defining a bean of type 'com.lly835.bestpay.service.impl.BestPayServiceImpl' in your configuration. Disconnected from the target VM, address: '127.0.0.1:60768', transport: 'socket' Process finished with exit code 1
写回答
1回答
-
vcfriend
提问者
2018-04-20
问题得到解决了.
错误提示是:Consider defining a bean of type 'com.lly835.bestpay.service.impl.BestPayServiceImpl' in your configuration.
原因是没有为WechatPayConfig类添加@Component注解.
导致提示BestPayServiceImpl的Bean没定义.
00
相似问题