目前有发现的两种情况

第一种:是在继承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的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. 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 ...

  7. 【解决方案】 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userHandler': Injection of resource dependencies failed;

    一个错误会浪费好多青春绳命 鉴于此,为了不让大家也走弯路,分享解决方案. [错误代码提示] StandardWrapper.Throwableorg.springframework.beans.fac ...

  8. 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 ...

  9. 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 ...

随机推荐

  1. 常见DOS操作

    D: 去往D盘 cd.. 返回上一级目录 cd 文件名 目录切换到该文件名(子目录)下 cd \ 直接回根目录 dir 当前根目录下的文件目录 dir /s 所有目录

  2. vue中的时间修饰符stop,self

    stop阻止自身以外的冒泡 self只会阻止自身冒泡

  3. 面试题 —— Ajax的基本原理总结

    Ajax 的全称是Asynchronous JavaScript and XML(异步的JavaScript 和 XML),其中,Asynchronous 是 异步 的意思,它有别于传统web开发中采 ...

  4. Android 最新架构

    1.Android系统架构 最新的Android系统分为五层六区(域): Linux内核层(Linux Kernel):Android系统基于Linux2.6内核,这一层为Android设备各种硬件提 ...

  5. pytorch torch.Stroage();torch.cuda()

    转自:https://ptorch.com/news/52.html torch.Storage是单个数据类型的连续的一维数组,每个torch.Tensor都具有相同数据类型的相应存储.他是torch ...

  6. [梁山好汉说IT] 区块链在梁山的应用

    [梁山好汉说IT] 区块链在梁山的应用 0x00 摘要 区块链属于一种去中心分布式数据存储系统,有其擅长的应用场景,也有其缺点. 下面用梁山为例来阐释下区块链部分概念&应用. 0x01 梁山好 ...

  7. vue学习笔记(六)表单输入绑定

    前言 在上一章vue学习笔记(四)事件处理器这一篇博客的内容中,我们已经了解vue是如何绑定事件的,而本篇博客主要讲解的是vue中表单输入的绑定,通常我们自己提交信息的时候都是通过表单将信息到服务器的 ...

  8. VC windows 多网卡情况下 获取当前网卡ip地址

    参考 代码如下 记录下以后用得到或者能帮到有需要的朋友 #include <iostream> #include <WinSock2.h> #include <Iphlp ...

  9. SQLServer系统函数之字符串函数

    一.字符串函数 参数character_expression:由字符数据组成的字母数字表达式,可以是常量或变量,也可以是字符列或二进制数据列 参数integer_expression:是正整数,如果 ...

  10. 「Vijos 1283」「OIBH杯NOIP2006第二次模拟赛」佳佳的魔杖

    佳佳的魔杖 背景 配制成功了珍贵的0号药水,MM的病治好了.轻松下来的佳佳意外的得到了一个好东西--那就是--一种非常珍贵的树枝.这些树枝可以用来做优质的魔杖!当然了,不能只做自己的,至少还要考虑到M ...