启动报错:
2019-06-01 18:09:50.088 [main] ERROR o.s.boot.SpringApplication - Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'PrizeGiftActivityController': Unsatisfied dependency expressed through field 'PrizeGiftBiz'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'PrizeGiftWebBiz': Injection of @org.apache.dubbo.config.annotation.Reference dependencies is failed; nested exception is java.lang.IllegalStateException: Duplicate consumer configs: <dubbo:consumer group="qiyufeng.mall.product.dev" lazy="false" sticky="false" generic="false" prefix="dubbo.consumer" valid="true" id="product-consumer-config" /> and <dubbo:consumer group="qiyufeng.mall.user.dev" lazy="false" sticky="false" generic="false" prefix="dubbo.consumer" valid="true" id="user-accesstoken-consumer-config" />
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1378)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:575)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:846)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at com.qiyufeng.mall.prize.web.WebApplication.main(WebApplication.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'PrizeGiftWebBiz': Injection of @org.apache.dubbo.config.annotation.Reference dependencies is failed; nested exception is java.lang.IllegalStateException: Duplicate consumer configs: <dubbo:consumer group="qiyufeng.mall.product.dev" lazy="false" sticky="false" generic="false" prefix="dubbo.consumer" valid="true" id="product-consumer-config" /> and <dubbo:consumer group="qiyufeng.mall.user.dev" lazy="false" sticky="false" generic="false" prefix="dubbo.consumer" valid="true" id="user-accesstoken-consumer-config" />
at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.postProcessPropertyValues(AnnotationInjectedBeanPostProcessor.java:133)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1383)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:575)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:273)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1237)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1164)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593)
... 27 common frames omitted
Caused by: java.lang.IllegalStateException: Duplicate consumer configs: <dubbo:consumer group="qiyufeng.mall.product.dev" lazy="false" sticky="false" generic="false" prefix="dubbo.consumer" valid="true" id="product-consumer-config" /> and <dubbo:consumer group="qiyufeng.mall.user.dev" lazy="false" sticky="false" generic="false" prefix="dubbo.consumer" valid="true" id="user-accesstoken-consumer-config" />
at org.apache.dubbo.config.spring.ReferenceBean.afterPropertiesSet(ReferenceBean.java:99)
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceBeanBuilder.postConfigureBean(ReferenceBeanBuilder.java:170)
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceBeanBuilder.postConfigureBean(ReferenceBeanBuilder.java:46)
at org.apache.dubbo.config.spring.beans.factory.annotation.AbstractAnnotationConfigBeanBuilder.configureBean(AbstractAnnotationConfigBeanBuilder.java:111)
at org.apache.dubbo.config.spring.beans.factory.annotation.AbstractAnnotationConfigBeanBuilder.build(AbstractAnnotationConfigBeanBuilder.java:77)
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.buildReferenceBeanIfAbsent(ReferenceAnnotationBeanPostProcessor.java:208)
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:113)
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:50)
at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.getInjectedObject(AnnotationInjectedBeanPostProcessor.java:342)
at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor$AnnotatedFieldElement.inject(AnnotationInjectedBeanPostProcessor.java:522)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.postProcessPropertyValues(AnnotationInjectedBeanPostProcessor.java:129)
... 38 common frames omitted
在依赖的类上加@Order就可以了
@Order
public class PrizeGiftWebBiz {...}
分享到:
相关推荐
总结来说,Spring Boot整合Mybatis-Plus时启动报错的主要原因是Mapper接口没有被正确地扫描和注册为bean。通过在启动类上使用`@MapperScan`或在每个Mapper接口上使用`@Mapper`注解,可以有效地解决这个问题。同时,...
Springboot启动报错时实现异常定位 Spring Boot是一个由Pivotal团队提供的...本文主要介绍了Spring Boot启动报错时实现异常定位的方法,通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值。
Spring Boot项目通常期望有一个明确的启动入口,即带有`@SpringBootApplication`注解的类,这个注解集成了`@Configuration`,`@EnableAutoConfiguration`和`@ComponentScan`,是Spring Boot应用的核心。在本例中,有...
Spring Boot 是一个由 Pivotal 团队开发的 Java 框架,旨在简化 Spring 应用程序的初始搭建以及开发过程。它提供了预配置的依赖项和自动配置功能,使得开发者可以更快地构建可运行的独立应用。在这个"spring boot ...
Spring Boot 启动报错 "Failed to determine a suitable driver class" 解决方案 在 Spring Boot 应用程序中,启动报错 "Failed to determine a suitable driver class" 是一个常见的问题。本文将详细介绍该错误的...
《Spring Boot异常处理器详解》 在Java开发领域,Spring Boot以其简洁、高效的特性深受开发者喜爱。在实际项目中,处理异常是必不可少的一部分,Spring Boot为此提供了强大的异常处理机制。本篇将深入探讨Spring ...
### Spring Boot项目导出WAR包并部署到Tomcat遇到404错误的解析与解决方案 在实际开发过程中,经常会遇到将Spring Boot应用打包为WAR格式并部署至Tomcat服务器的需求。这种方式可以更好地与传统Java Web项目的部署...
6. **运行应用**:在Eclipse中可以直接运行主类启动Spring Boot应用。 7. **测试**:编写单元测试或集成测试,确保代码质量。 在这个"demo"项目中,由于描述中提到POM无报错,我们可以推断项目的构建配置是正确的...
### MySQL 数据库在 Spring Boot 项目中启动报错问题解析 #### 错误信息解读 在给定的信息中,我们注意到一个具体的错误信息:...
总的来说,Spring Boot启动时MyBatis报循环依赖的错误可能是由于`spring-boot-devtools`与自动配置的冲突,或者是配置文件中的MyBatis配置不完整或不正确。通过理解Spring Boot的运行机制,检查并修复配置,通常能...
在Spring Boot应用中,日志系统是至关重要的组成部分,它帮助开发者记录应用程序的运行状态、错误信息以及调试信息。Logback是Spring Boot默认的日志实现,然而,在配置或使用过程中,可能会遇到各种问题,比如本题...
用SpringBoot + Spring Data JPA操作数据库 项目启动的时候 报了一个错 SpringBoot的版本是2.2.6.RELEASE org.springframework.beans.factory.BeanCreationException: Error creating bean with name '...
Quartz Scheduler的Spring-Boot自动配置只是Quartz Scheduler的Spring-Boot启动器。 当然,Quartz Scheduler已经有好几个启动器,但是它们都不能满足我的所有需求,因此我创建了自己的启动器。 这只是一个业余项目。...
Spring Boot作为一个流行的Java开发框架,提供了丰富的安全特性来帮助开发者构建安全的应用。本文将深入探讨如何在Spring Boot项目中利用PBEWITHHMACSHA512ANDAES-128算法对配置文件中的密码进行加密。 首先,让...
通过在测试类上添加此注解,我们可以启动一个完整的Spring应用上下文,这样就可以测试整个应用或者特定的组件。例如: ```java @SpringBootTest public class MyApplicationTests { // 测试方法 } ``` 对于单元...
通过自动配置特性,Spring Boot允许开发者快速启动并运行应用,而无需进行大量的配置工作。 Mybatis则是一个轻量级的Java持久层框架,它提供了灵活的SQL映射机制,使得开发者可以直接编写SQL语句,避免了JDBC的繁琐...
* `spring.main.show-banner`:是否显示启动Banner,默认为true。 Logging * `logging.path`:日志文件的路径,默认为`/var/logs`。 * `logging.file`:日志文件的名称,默认为`myapp.log`。 * `logging.config`:...
Spring Boot的Starter启动器是指Spring Boot提供的一些starter pom,它们可以帮助开发者快速搭建一个Spring Boot应用程序。 Starter启动器可以自动配置应用程序的依赖关系和配置文件。 全局配置文件 Spring Boot的...
在Spring Boot应用中,日志配置是一个至关重要的环节,因为它对于系统的监控、调试以及问题排查起着关键作用。本文将详细介绍如何在Spring Boot中配置日志系统,包括默认的日志系统、如何打印日志以及如何将日志信息...
SpringCloud作为一套微服务解决方案,提供了丰富的工具集,其中包括Eureka,它是Netflix开发的服务注册与发现组件。本文将深入探讨如何在SpringBoot项目中集成SpringCloud Eureka,实现服务的注册与发现。 首先,...