启动项目的时候报错: Loading XML bean definitions from class path resource [applicationContext.xml]

  记录一下:

org.springframework.context.support.AbstractApplicationContext prepareRefresh
Refreshing org[email protected]7cef4e59: startup date [Fri Sep 30 09:33:28 CST 2016]; root of context hierarchy
org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
Loading XML bean definitions from class path resource [applicationContext.xml]

    Loading XML bean definitions from class path resource [applicationContext.xml] 今天小伙伴遇到了这个了问题。

    原因是,在创建spring项目后,缺少日志jar所导致的问题,所以只需要导入相应的日志jar即可。

日志jar相关:

  commons-logging:避免和具体的日志方案直接耦合,通过统一接口解耦。

  log4j:最典型日志解决方案。具体的日志系统 。通过 slf4j-log4j12初始化Log4j,达到最终日志的输出。

  slf4j(Simple Logging Facade for Java):为java提供的简单日志门面。slf4j入口是众多接口的集合,所有接口都定义在 slf4j-api 中

                              (注:导入时不要同时出现多个实现slf4j的包出现,否则编译时 会报错)

  slf4j-api:本质上 slf4j-api是个接口定义

  slf4j-log4j12:链接slf4j-api和log4j中间的适配器,实现了slf4j-apiz中StaticLoggerBinder接口,从而使得在编译时绑定的是slf4j-log4j12的 getSingleton()方法

在Mybatis+spring项目中,习惯直接拷入这几个jar

         



 

记录点点滴滴,虽然微不足道。                  

时间: 2024-08-29 12:07:05

启动项目的时候报错: Loading XML bean definitions from class path resource [applicationContext.xml]的相关文章

class path resource [applicationContext.xml] cannot be opened because it does not exist

今天给游戏管理端添加新功能,启动时报错 Caused by: java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist 找不到文件 1.查看项目资源目录,applicationContext.xml  位于conf下 2.查看applicationContext.xml 的配置 3.查看项目classpath配置,没有

启动项目,编译报错:Consider defining a bean of type 'XXX' in your configuration.

在controller层注入ConfigBean,编译器报错: 一开是以为是intellij idea 的告警级别设定的问题,就没有在意,继续启动项目,结果控制台报错:Consider defining a bean of type 'XXX' in your configuration. 错误信息显示找不到这个Bean类. 但是我明明写了啊. 后来经过一番查找,大概有了如下理解:主要问题出在@SpringBootApplication 这个注解上. 点进这个注解,可以看到,此注解功能大概由下面

Spring Boot 2.1.7 启动项目失败,报错: "Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured."

一开始按照网上的很多解决办法是: 启动类头部声明@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class}),但是这样会排除掉我自己的数据库配置, 检查了很多地方都没发现问题在哪里,最后自己猜想不论怎么修改application.yml文件,都不生效,是不是因为这个配置文件就没有被加载到? 带着这个想法我就去网上搜了一下问题,有个问题看到了target目录的作用,就去想了一下是不是application.yml文件没有被

解决 java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist

前几天好好运行的web项目突然跑不起来了 报这个错误 2019-09-16 19:18:29 [ RMI TCP Connection(3)-127.0.0.1:357 ] - [ ERROR ] Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource

Caused by: java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be ope

1.错误描述 java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99) at org.springframework.test.context.DefaultTestContext.

Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; neste

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.AbstractMethodError: com.

原创:idea启动项目的是否报错:java.lang.ClassNotFoundException: javax.servlet.ServletContext

在Intellij IDEA中默认所有 scope 为 provided 的依赖不会被加入到 classpath: 想想配置正确,怎么不能创建窗容器呢 ava.lang.ClassNotFoundException: javax.servlet.ServletContext 2020-03-21 17:33:17,156 WARN [org.springframework.context.support.ClassPathXmlApplicationContext] - Exception en

java.io.FileNotFoundException: class path resource [XXXXX.xml] cannot be opened

java.io.FileNotFoundException: class path resource [beans.xml] cannot be opened because it does not exit. 在用maven管理的spring项目中做单元测试时候,加载不了spring的配置文件.出现该问题的原因是,用maven创建的项目,必须把spring的配置文件beans.xml或者applicationContext.xml放到系统根目录下,做单元测试时候用 ApplicationCon

ios替换app启动图片时系统报错的解决办法

ios替换app启动图片时系统报错的解决办法:我个人建议是在开发时候经常行的保存项目,并且在修改项目图标图片.app启动图片前,一定要先备份一份没有添加这两项图片的项目. 如果您的项目已经开发完成了,进入到发布前添加项目图标.app启动图片的时候,一定要确定了这两项的所有图片不会更改了再去添加,否则更改已经添加好的加项目图标.app启动图片就会报错, 如果您报错了,百度之后也没有解决办法,那么就尝试在已经备份的项目中重新去添加图片就可以了.