项目场景:
提示:这里简述项目相关背景:
例如:项目场景:示例:通过蓝牙芯片(HC-05)与手机 APP 通信,每隔 5s 传输一批传感器数据(不是很大)
问题描述
报错:IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist:
原因分析:
target中没有同步applicationContext.xml文件
解决方案1:
idea不会自动将新保存的文件或目录及其他资源更新到target目录中,必须在pom.xml中设置
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<!-- 这里的** 代表会查看多级目录下,*代表单级目录-->
<include>**/*.*</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
</build>
i然后maven clean 一下,他会删除掉这个项目的target目录,最后重启项目就可以了
解决方案2:
将pom.xml中的pom改为jar
i然后maven clean 一下,他会删除掉这个项目的target目录,最后重启项目就可以了