配置无法从相对位置导入Bean定义(Configuration Failed to import bean definitions from relative location)
我的文件夹结构是:
src/main---java resources/META-INF/Spring-context/application.xml webapp/WEB-INF--web.xml despatcher-servlet.xml从webapp/WEB-INF/despatcher-servlet我试图导入application.xml之类的
<import resource="classes/META-INF/spring-context/application.xml"/>像配置问题得到异常:无法从相对位置导入bean定义[classes/META-INF/springcontext/application.xml]任何人都可以帮助我。
My folder structure is:
src/main---java resources/META-INF/Spring-context/application.xml webapp/WEB-INF--web.xml despatcher-servlet.xmlfrom webapp/WEB-INF/despatcher-servlet i am trying to import application.xml like
<import resource="classes/META-INF/spring-context/application.xml"/>getting exception like Configuration problem: Failed to import bean definitions from relative location [classes/META-INF/springcontext/application.xml] Can any one help me.
最满意答案
您的配置文件位于类路径中,因此您必须使用classpath: prefix还会从路径中删除类。 您的设置将是:
classpath:META-INF/springcontext/application.xmlYour configuration file is in classpath so you have to use classpath: prefix also remove classes from the path. Your settings will be:
classpath:META-INF/springcontext/application.xml更多推荐
xml,application,META-INF,import,导入,电脑培训,计算机培训,IT培训"/> <meta name=
发布评论