项目中运行报错: Loading XML bean definitions from class path resource [applicationContext.xml]

时间:2021-08-21 20:00:28

  记录一下:

org.springframework.context.support.AbstractApplicationContext prepareRefresh
Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@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

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQ4AAABbCAIAAAAN5/wCAAAIVUlEQVR4nO2d22/bVBzH/dfx30R+5WUvTHQS0qSOFTRLlG4d2gRKunVV6Fno7i1IKRuyNCqKhFqgQ6YdW5er49gRD3biY5+Lj2Mn8ebvR36Yj88t6/n6/Hw5X2suAEABbdEdAOD9AFIBQAlIBQAlhFJ5LObhw4eNRmOevQRg4cik4g6Hrjv0PNfz3NHIG4081x2ORl6z2SSEQC2gVAil8ujRo+HQYdUyGnl7e3u9Xm97e3tnZ2eOXQVgkQil8uDBA8cZcNXSaDQIIR/cxGIammHmWJ9FdE0nVo41gkUilMrOzo4zsJ88/615cLR/cLx/cNz89Wj/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LdKK7JWEx0p4GhRHoRSKZINxbgG3oreYMKKNThZwi9rJVoJ+zPCVDhalJ3QhoKVSoFsKGRSiUVXdDOKrfDnQYXgCI4WZSFiQ8FKpUA2FJIALNgRBWAqrXCcX9TGLxwtygBjQ8FKpUg2FAqX9ZRTReSyXtYKz5gi8tRD9OADjhalgbWhYKVSeBsKMfK4BguNwVQIpVJ4G4pY0ci0k6AUnM5BeoRSKbwNRRQqJhIKIXsroMQIpQIAoAmkculbs9UdLLYrABSZQCr3fvqT/HzSt4fzX4cJwHtBIJWe7dR2jy/eNhe+2B8btmJuMDcCQAlIBQAlIBUAlIBUAFDif7TI4HAL8j1PAAAAAElFTkSuQmCC" alt="" />         


                                          

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