配置无法从相对位置导入Bean定义(Configuration Failed to import bean definitions from relative location)

编程入门 行业动态 更新时间:2024-10-28 08:26:22
配置无法从相对位置导入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.xml

from 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.xml

Your 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=

本文发布于:2023-08-01 11:08:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1357698.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:定义   位置   Configuration   Failed   Bean

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!