Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name
目前有发现的两种情况
第一种:是在继承jpa的时候检查实体类@id和@Entity引进的包是否是
import javax.persistence.Id
imprt javax.persistence.Entity;
import javax.persistence.Table;
第一次引进很容易引错包下面是错误的包
org.springframework.data.annotation.Id;
要不然你就得去找找你的dao与service的注解是不是漏掉了
第二种:情况属于比较少见的
无法注入Dao中的Bean!
SpringBoot项目的Bean装配默认规则是根据Application类所在的包位置从上往下扫描! “Application类”是指SpringBoot项目入口类。这个类的位置很关键:
如果Application类所在的包为:com.ssm.springboot
,则只会扫描com.ssm.springboot
包及其所有子包,如果service或dao所在包不在com.ssm.springboot
及其子包下,则不会被扫描!
这种情况也会导致注入不进去的错误
解决办法
将SpringbootApplication放在要扫描包包中
一定不要如下图另起一个包要不然
@ComponentScan他也救不了你

最简单的你是这样了

放置于自动扫描包的同一包名下
Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name的更多相关文章
- ssh整合报错严重: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxx'
错误描述:eclipse整合ssh的时候 报不能创建名字为xxx的对象 信息: Destroying singletons in org.springframework.beans.factory.s ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0'
七月 05, 2018 10:26:54 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRul ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.SetAllPropertiesRule begin警告: [SetAllPropertiesRu ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'catchFromPBomService': Cannot create inner bean '(inner bean)#302efb82' of type [com.thinkgem.jeesite.modules.fd
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'catchFromPBo ...
- mvn ssm 异常 org.springframework.beans.factory.BeanCreationException:Error creating bean with name 'multipartResolver'
解决方案: 添加 commons-fileupload-1.2.jar <!-- https://mvnrepository.com/artifact/commons-fileupload/co ...
- Dubbo管理平台搭建(duboo-admin-2.5.4)遇到的问题:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uriBrokerService': Cannot create inner bean '(inner bean)' of type
1.将dubbo的war包方式tomcat的webapps文件夹下,启动tomcat报错 错误信息如下: ERROR context.ContextLoader - Context initializ ...
- 【解决方案】 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userHandler': Injection of resource dependencies failed;
一个错误会浪费好多青春绳命 鉴于此,为了不让大家也走弯路,分享解决方案. [错误代码提示] StandardWrapper.Throwableorg.springframework.beans.fac ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [bean.xml]: Invocation of init method failed; nested exception is
在复制xml文件进行修改的时候,我经常将不小心对原文件进行修改,而导致创建bean出错.报错如下所示: Exception sending context initialized event to l ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stu' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stu' defined ...
随机推荐
- while循环&CPU占用率高问题深入分析与解决方案
直接上一个工作中碰到的问题,另外一个系统开启多线程调用我这边的接口,然后我这边会开启多线程批量查询第三方接口并且返回给调用方.使用的是两三年前别人遗留下来的方法,放到线上后发现确实是可以正常取到结果, ...
- 算法提高 密码锁 (BFS)
问题描述 你获得了一个据说是古代玛雅人制作的箱子.你非常想打开箱子看看里面有什么东西,但是不幸的是,正如所有故事里一样,神秘的箱子出现的时候总是会挂着神秘的锁. 这个锁上面看起来有 N 个数字,它 ...
- 原生js重写each方法
js原生有个for-each方法,但是只能遍历数组不能遍历对象; jq有个$.each倒是可以遍历数组和对象,但是项目中如果不想用jq呢,我们就用原生来写一个吧. [12,23,34].forEach ...
- dotnet 获取程序所在路径的方法
在 dotnet 有很多方法可以获取当前程序所在的路径,但是这些方法获取到的路径有一点不相同,特别是在工作路径不是当前的程序所在的路径的时候 通过下面几个方法都可以拿到程序所在的文件夹或程序文件 Ap ...
- 为何D3D11的几个矩阵需要转置?
在学习D3D11的时候遇到一个问题,事情是这样的: D3D11引入了常量缓存(const buffer)用来实现数据的高速传输,这块儿buffer是CPU Only Write,GPU Only Re ...
- ES基本语法
7.2.0版本 1 创建库 http://{ip}:{port}/{库名称} put 2 查询库 http://{ip}:{port}/_cat/indices?v get health status ...
- redis分布式锁使用方法
引用: StackExchange.Redis.dll Redlock.CSharp.dll RedLock.dll 代码: public class RedlockHelper { public v ...
- Avram Joel Spolsky给计算机系学生的建议
Avram Joel Spolsky给计算机系的学生给了如下建议: (1)毕业前练好写作 (2)毕业前学好C语言 (3)毕业前学好微观经济学 (4)不要因为枯燥就不选修 ...
- 【E20200101-1】Centos 7.x 关闭防火墙(firewall)和SELinux
一.准备工作 1.1.服务器准备 操作系统:centos 7.x 1.2.安装好用的文本编辑工具nano # yum -y install nano 二.关闭SELinux 2.1.查看SELinux ...
- vue递归组件 (树形控件 )
首先我们要知道,既然是递归组件,那么一定要有一个结束的条件,否则就会使用组件循环引用,最终出现“max stack size exceeded”的错误,也就是栈溢出.那么,我们可以使用v-if=&qu ...