springboot启动时的一个bug

项目启动就有这个错 Error creating bean with name ‘XXXXXXXX‘: Cannot create inner bean ‘(inner bean)#1f930774‘ of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property ‘entityManager

  • 这虽然是个警告但是就是起不来

    2019-06-16 22:13:58.504 WARN 28636 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘XXXXXXXX‘: Unsatisfied dependency expressed through field ‘XXXXXXXX‘; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘XXXXXXXX‘: Unsatisfied dependency expressed through field ‘XXXXXXXX‘; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘XXXXXXXX‘: Cannot create inner bean ‘(inner bean)#1f930774‘ of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property ‘entityManager‘; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘(inner bean)#1f930774‘: Cannot resolve reference to bean ‘entityManagerFactory‘ while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘entityManagerFactory‘ available

  • 现在的启动项是这样的

    @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})

    @EnableDiscoveryClient

    @EnableFeignClients

    @Slf4j

  • 原来的启动项是这样的

    @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})

    @ComponentScan(basePackages = {"cn.enn.advisor"})

    @EnableAutoConfiguration

    @EnableDiscoveryClient

    @EnableFeignClients

    @Slf4j

  • @SpringBootApplication 虽然这个注解包含了 @ComponentScan @ EnableAutoConfiguration @Configuration

    但是不加就是会报错,这里记录一下,找到原因再更新

来自为知笔记(Wiz)

原文地址:https://www.cnblogs.com/thymeleaf/p/11037300.html

时间: 2024-07-31 05:21:14

springboot启动时的一个bug的相关文章

Springboot 启动时Bean初始化,启动异常-Assert.isTrue(condition,message) 报错

Springboot 启动时Bean初始化启动异常Assert.isTrue(condition,message) 报错,如果 condition为false 则会出现 java.lang.IllegalArgumentException: message, org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XXXXXX' defined in class path re

【问题解决:信息提示】SpringBoot启动时提示The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path

问题描述 springboot程序在启动时提示信息 [2018-10-24 21:59:05.214] - 440 信息 [restartedMain] --- org.apache.catalina.core.StandardService: Starting service [Tomcat] [2018-10-24 21:59:05.220] - 440 信息 [restartedMain] --- org.apache.catalina.core.StandardEngine: Start

【Qt】无边框窗体中带有ActiveX组件时的一个BUG

无意中发现的一个BUG,Qt5.1.1正式版首先创建一个GUI工程,拖入一个QAxWidget控件(为了使ActiveX生效,需要在.pro文件中加入CONFIG += qaxcontainer)接着,为了让ActiveX有效,需要引入一个组件,我这里引入的是IE组件 [cpp] view plain copy MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->s

ADO.NET(OleDb)读取Excel表格时的一个BUG

如果我们有例如以下一个Excel表格: 如今要使用C#程序读取其内容: using System; using System.Data.OleDb; namespace Skyiv.Ben.Test {   sealed class ExcelTest   {     static void Main()     {       try       {         using (OleDbConnection conn = new OleDbConnection("Provider=Micr

SpringBoot启动时的Banner设置

对于使用过Spring Boot的开发者来说,程序启动的时候输出的由字符组成的Spring符号并不陌生.这个是Spring Boot为自己设计的Banner: 1.    .   ____          _            __ _ _ 2.   /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \ 3.  ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ 4.   \\/  ___)| |_)| | | | | || (_|

springboot启动时控制台不显示映射的URL

背景 今天,第一次使用 2.2.0 版本的springboot,在访问接口时发现访问不到,于是在控制台进行 URL 搜索,发现并相关没有内容 原因 springboot版本差异,切换回 2.0.5.RELEASE ,启动项目,发现控制台又正常打印API了 解决方法 2.2.0 版本中,配置文件中更改 org.springframework.web 包的日志级别: logging: level: org.springframework.web: TRACE 启动项目,查看控制台打印: 总结 Spr

echarts折线图动态改变数据时的一个bug

echarts折线图中当增加dataZoom,修改start大于0的时候,会出现折线混乱,变成竖直的线,绘制有问题. 解决方法,在dataZoom中增加filterMode: 'empty' http://gallery.echartsjs.com/editor.html?c=xS1T_X893l&v=2

SpringBoot在启动时的多环境配置以及加载顺序

通常我们在开发完成一个SpringBoot项目时,总是要打包部署的. 在启动SpringBoot应用时,我们常常会使用命令java -jar xxx.jar来启动这个服务. 命令java -jar 除了启动应用之外,还可以在命令中指定应用的参数,比如一下带参数的命令: (1)java -jar xxx.jar --server.port=8081,直接以命令的方式来设置服务的访问端口server.port属性,将端口设置为8081; (2)java -jar -Xms1024m -Xmx1024

springboot启动过程(1)-初始化

1   springboot启动时,只需要调用一个类前面加了@SpringBootApplication的main函数,执行SpringApplication.run(DemoApplication.class, args)即可,这里初始化了一个SpringApplication实例,然后调用run启动springboot.run方法中,调用了initialize,如下 @SuppressWarnings({ "unchecked", "rawtypes" }) p