Spring 报错:Error creating bean with name

org.springframework.beans.factory.BeanCreationException:

原因是在autowire时,找不到相应的类,上述问题是因为XXXXX的实现类中没有加相应的注解。如dao层 @Repository  如service层  @Service

  1. 出现上述问题的原因是没有在相应的实现类中追加相应的注解。

    本人发现的问题是在Service层的实现类中没有追加:

    @Service("XXXXX")

  2. 2

    在service的实现类XXXXXServiceImpl.java的开始,追加@Service("XXXXX"),如下:

    @Service("XXXXX")

    public class XXXXXServiceImpl implements XXXXXService{

    ......

    }

  3. 3

    追加完之后,把代码刷新并clean一下,重新启动tomcat,一般都会成功。

时间: 2024-10-21 18:38:20

Spring 报错:Error creating bean with name的相关文章

Spring Boot报错Error creating bean with name 'userRepository': Invocation of init method failed; nested exception

问题:出现UserRePository注入创建失败,一定先检查所有的@注解是否已经标记 问题发现:entity下的实体类上面没有加注解  任何基于hibernate的实体类一定要加上@Entity注解! Spring Boot报错Error creating bean with name 'userRepository': Invocation of init method failed; nested exception 原文地址:https://www.cnblogs.com/my-prog

idea报错 Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource

核对一下控制器是不是写了相同的路径...org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$EnableWebMvcC

java数据库执行迁移报错Error creating bean with name 'flywayInitializer' defined in class path resource

报错原因 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocati

SpringBoot启动zipkin-server报错Error creating bean with name ‘armeriaServer’

目前,GitHub 上最新 release 版本是 Zipkin 2.12.9,从 2.12.6 版本开始有个较大的更新,迁移使用 Armeria HTTP 引擎. 从此版本开始,若直接添加依赖的 Spring Boot 应用启动会存在冲突,会报上面的错,降到2.12.3版本就可以正常启动了. 参考文章 来自blog.koreyoshi.work 原文地址:https://www.cnblogs.com/z-jx/p/11581885.html

spring boot maven install时报错 Error creating bean with name 'serverEndpointExporter'

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverEndpointExporter' defined in class path resource [com/pky/testmybatis/config/WebSocketConfig.class]: Invocation of init method failed; nested exception is j

spring AOP使用中Error creating bean with name ‘…’defined in class path resource..问题及其解决方法

2018/3/24 异常小记 工作环境:myeclipse2015(jar与java compiler 版本一致).windows10 工作内容:spring 中AOP的使用测试 异常信息: Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AuthBeforeAdvice' defined in class

Spring Boot 报错:Error creating bean with name 'entityManagerFactory' defined in class path resource

spring boot 写一个web项目,在使用spring-data-jpa的时候,启动报如下错误: Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.2018-04-02 17:00:47.076 ERROR 4648 --- [ main] o.s.boot.SpringApplication : A

Error creating bean with name 'security.filter.filterInvocation' defined in URL 报错

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'security.filter.filterInvocatio

【报错】org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSocketHandlerMapping' defined in class path resource

环境:maven+eclipse+jdk1.8 [tomcat使用的是maven自带的插件,实质原因就是出在tomcat版本问题] 背景:在进行SSM集成WebSocket的时候,项目启动报org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSocketHandlerMapping' defined in class path resource错误,详细如下 org.

spring Boot启动报错Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes

spring boot 启动报错如下 org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure