首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >正在加载应用程序上下文文件Bean.xml

正在加载应用程序上下文文件Bean.xml
EN

Stack Overflow用户
提问于 2016-03-20 00:05:19
回答 1查看 442关注 0票数 0

我想要自定义现有的project。我可以在没有任何错误的情况下构建和部署该项目。我的问题是如果我试图加载我的BeanLocation.xml

代码语言:javascript
复制
 new ClassPathXmlApplicationContext("file:spring/config/BeanLocations.xml");

它抛出错误:

代码语言:javascript
复制
class org.springframework.beans.factory.BeanDefinitionStoreException
IOException parsing XML document from URL [file:resources/spring/config/BeanLocations.xml]; nested exception is java.io.FileNotFoundException: resources/spring/config/BeanLocations.xml (No such file or directory)

如果你仔细看看我的类路径:

代码语言:javascript
复制
 C:/Program Files/Java/jdk1.8.0_60/lib/tools.jar;C:/Users/admin/workspace/ssf/samples/customcontroller/../../as-common/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../as-shared/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../commons-httpclient-contrib/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../gwt/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../indexer-lucene/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../jboss-portal/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../liferay/liferay/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../liferay-light/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../lucene-contrib/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../main/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../main-minimum/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../portal-module/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../remoting/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../rest-shared/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../slide-webdavclient/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../ssfs/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../taglib/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../tools/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../util/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../util-search/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../liferay/teaming/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/src/resources

然后,您将找到包含文件C:/Users/admin/workspace/ssf/samples/customcontroller/src/resources/spring/config/BeanLocation.xmlC:/Users/admin/workspace/ssf/samples/customcontroller/src/resources

EN

回答 1

Stack Overflow用户

发布于 2016-03-20 00:13:31

您正在使用file uri。这种uri并不关心类路径,而是读取与当前文件夹相关的文件。

使用classpath uri,或使用正确的路径设置file uri。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36103930

复制
相关文章

相似问题

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