项目场景:
提示:这里简述项目相关背景:
配置文件不在resource文件夹下
问题描述
提示:这里描述项目中遇到的问题:
@ImportResource扫描不到配置文件
报错内容
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [dubbo-config.xml]; nested exception is java.io.FileNotFoundException: class path resource [dubbo-config.xml] cannot be opened because it does not exist
或 系统找不到指定文件
//@ImportResource( value = { "file:config/dubbo-config.xml" } )
@SpringBootApplication(scanBasePackages = {"org.stvd.repository", "org.stvd.service","org.stvd.core.jdbc"})
@ImportResource({ "classpath:dubbo-config.xml" })
public class Application {
原因分析:
提示:这里填写问题的分析:
配置文件默认不在resource文件下
解决方案:
提示:这里填写该问题的具体解决方案:
1.进入项目设置
2.选择对应项目
3.添加你的文件目录为resource文件
问题解决