我在mac上运行eclipse,并在/ Library/WebServer/apache-tomcat中拥有我的tomcat文件夹。 我在eclipse中使用tomcat 7服务器,并将其配置为使用原始的tomcat文件夹作为其工作目录。集成在eclipse classpath中的Tomcat 7问题
问题是,当在Spring 3.1中使用PropertyPlaceholderConfigurer bean并将位置指定为“classpath:database.properties”时,当我启动tomcat时,它总会给我一个FileNotFoundException。
我已经尝试将database.properties文件放在tomcat文件夹的lib,conf和根文件夹中。
我没有选择,请帮忙!
编辑1
试图圭多Simone的解决方案,但我得到:
ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: /Library/WebServer/apache-tomcat-7.0.32/conf/database.properties (No such file or directory)
所以,我终于看到了春天正在寻找的文件(这是正确的)的完整路径和文件身体在那里。还有其他建议吗?如果这是行得通的,其他web服务器是否也有这个catalina.base变量还是这个tomcat特定的?因为我需要在以后的阶段独立平台。
查看更新的答案。 –