idea的maven项目运行出错_java.io.FileNotFoundException: class path resource [spring/sprint-tx.xml] cannot be opened because it does not exist
前提:idea maven ssm
错误信息如下:
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring/sprint-tx.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring/sprint-tx.xml] cannot be opened because it does not exist
...省略
Caused by: java.io.FileNotFoundException: class path resource [spring/sprint-tx.xml] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:330)
... 21 more
一直报 class path resource [spring/sprint-tx.xml]不存在!而且resource目录的文件加载不到target目录下的classes文件夹里
文件位置如下:

pom.xml文件配置了对resource文件 过滤
<!--配置Maven 对resource文件 过滤 -->
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>*</include>
<include>*/*</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
排查了好久,在网上也见其他人也出现了同种情况--》虽然配置了resources过滤,但是就是加载不到classes里面
、、、
直到又一次的排查中,瞄到了创建的目录,resource ??? 不是 resources
idea的maven项目默认的加载目录是 resources, pom.xml配置的也是<directory>src/main/resources</directory>
记录此次粗心造成的麻烦!
idea的maven项目运行出错_java.io.FileNotFoundException: class path resource [spring/sprint-tx.xml] cannot be opened because it does not exist的更多相关文章
- 解决CXF的java.io.FileNotFoundException: class path resource [META-INF/cxf/cxf-extension-soap.xml] cannot be opened because it does not exist
以下是错误信息 九月 25, 2017 8:22:04 下午 org.springframework.web.context.support.XmlWebApplicationContext prep ...
- java.io.FileNotFoundException: class path resource [META-INF/xfire/services.xml] cannot be opened because it does not exist
解决办法: maven创建项目时: META-INF目录下面新建一个xfire文件夹,把services.xml文件放到这个文件夹里,再将整个META-INF拷贝到WEB-INF中 clean一下工程 ...
- cxf(3.1.1) 异常Caused by: java.io.FileNotFoundException: class path resource [META-INF/cxf/cxf-extension-soap.xml]
Caused by: java.io.FileNotFoundException: class path resource [META-INF/cxf/cxf-extension-soap.xml] ...
- Caused by: java.io.FileNotFoundException: class path resource [spring/springmvc.xml] cannot be opene
Caused by: java.io.FileNotFoundException: class path resource [spring/springmvc. ...
- nested exception is java.io.FileNotFoundException: class path resource [spring/spring-datasource-mog
spring单元測试时发现的问题: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsin ...
- Spring报错:java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
感谢:http://blog.chinaunix.net/uid-20681545-id-184633.html提供的解决方案,非常棒 ! 问题说明: 新建一个Spring项目,新建一个Bean类:H ...
- Caused by: java.io.FileNotFoundException: class path resource
异常: java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.c ...
- parsing XML document from class path resource [config/applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [config/applicationContext.xml] 解决方案
parsing XML document from class path resource [config/applicationContext.xml]; nested exception is j ...
- Caused by: java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be ope
1.错误描述 java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.tes ...
随机推荐
- jstack 命令
NAME jstack - Prints Java thread stack traces for a Java process, core file, or remote debug server. ...
- 实例一 airflow_failover
源码: https://github.com/teamclairvoyant/airflow-scheduler-failover-controller #怎么判断scheduler是running的 ...
- hive的hiveserver2模式启动不起来,发现Hadoop一直处于安全模式
hive的hiveserver2模式启动不起来,发现Hadoop一直处于安全模式 命令介绍 命令hadoop fs –safemode get 查看安全模式状态 命令hadoop fs –safemo ...
- Spring系列七:Spring 自动装配
相思相见知何日?此时此夜难为情. 概述 在Spring框架中,在配置文件中声明bean的依赖关系是一个很好的做法,因为Spring容器能够自动装配协作bean之间的关系.这称为spring自动装配. ...
- BOF和EOF详解2
在学生信息管理系统中有多处用到EOF和BOF,使用BOF和EOF属性可确定Recordset对象是否包含记录,或者从一个记录移动到另一个记录是否超出Recordset对象的限制. BOF和EOF他们是 ...
- drf的三大认证
目录 三大认证任务分析 auth组件的认证权限六表 自定义User表分析 源码分析 认证与权限工作原理 源码分析 认证模块工作原理 权限模块工作原理 admin关联自定义用户表 自定义认证.权限类 用 ...
- vue技术分享之你可能不知道的7个秘密
本文是vue源码贡献值Chris Fritz在公共场合的一场分享,觉得分享里面有不少东西值得借鉴,虽然有些内容我在工作中也是这么做的,还是把大神的ppt在这里翻译一下,希望给朋友带来一些帮助. 一.善 ...
- T100——动态更改Label的说明
例子: #設定科目名稱 IF g_prog = 'aapt300' THEN CALL cl_set_comp_att_text("lbl_apca036",cl ...
- 版本管理工具svn(转)
这种操作类的文章就不自己再写了,感觉浪费时间. 找了一个写的不错的文章转载. 文中流程有些变动,但是问题不大,可能是版本原因. SVN服务器的本地搭建和使用 http://www.2cto.com/o ...
- C++ STL用法总结(持续更新)
Vector 动态数组 https://www.cnblogs.com/zhonghuasong/p/5975979.html lower_bound&&upper_bound htt ...