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配置,没有配置conf路径

4.添加conf路径到classpath中,问题解决

总结,一般文件找不到,跟classpath有关,检查classpath中有没有资源文件所在的目录,没有则加入;

原文地址:https://www.cnblogs.com/fengyanqing/p/12162786.html

时间: 2024-11-05 14:38:50

class path resource [applicationContext.xml] cannot be opened because it does not exist的相关文章

解决 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 [mappers/*.xml] cannot be opened because it does not exist

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'methodValidationPostProcessor' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Unsa

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

初学Spring在用Resource rs=new ClassPathResource("applicationContext.xml");时老是遇到这个错误.后来发现用ApplicationContext ctx=new  FileSystemXmlApplicationContext("WebContent/WEB-INF/applicationContext.xml"):可以解决这个问题.仔细研究了下:之所以我用ClassPathResource中找不到app

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.

parsing XML document from class path resource [applicationtext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationtext.xml] cannot be opened because it does not e

控制台异常: parsing XML document from class path resource [applicationtext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationtext.xml] cannot be opened because it does not exist 报错原因是 xml名字可能写错了 原文地址:https://www.cnbl

intellij idea中出现class path resource [spring/applicationContext.xml] cannot be opened because it does not exist

log4j:WARN No appenders could be found for logger (org.springframework.core.io.support.PathMatchingResourcePatternResolver).log4j:WARN Please initialize the log4j system properly. java.lang.ExceptionInInitializerError at sun.reflect.NativeConstructor

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

启动项目的时候报错: 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.XmlBeanDefinitio

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.