首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Java Hibernate项目的root-context.xml文件应该位于何处

Java Hibernate项目的root-context.xml文件应该位于何处
EN

Stack Overflow用户
提问于 2020-10-23 02:49:48
回答 1查看 36关注 0票数 0

我有一个新安装的eclipse版本: Version: 2020-09 (4.17.0)我正在尝试构建一个spring web应用程序并将其部署到Tomcat 7。当我执行maven-install时,我得到以下错误:

代码语言:javascript
复制
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [root-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [root-context.xml] cannot be opened because it does not exist

我将src/main/webapp/WEB-INF/spring中的root-context.xml添加到我的构建路径中。我不知道要不要把它搬到别的地方去。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-10-23 02:55:01

尝试将root-context.xml移动到src/main/resources目录,它将包含在eclipse目标文件夹中并正确运行。

如果您在测试路径中有测试添加,请在您的pom.xml上添加以下内容

代码语言:javascript
复制
<build>
....
<resources>
    <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
    </resource>
</resources>
<testResources>
    <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
    </testResource>
</testResources>
....
</build>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64488692

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档