【发布时间】:2013-09-09 10:27:40
【问题描述】:
我在我的 tomcat 服务器上部署了一个 Web 应用程序。 我的文件夹结构是 TOMCAT_HOME/webapps/segnalazioni_degrado/config。
config 文件夹包含一些属性文件。 当我在开发模式(Eclipse)下运行我的应用程序时,一切正常,但由于我将它部署在 Tomcat 上,我得到了 filenotfound 异常。 这是我在服务器上加载 .properties 文件的方式:
[...]
Properties props = new Properties();
try {
props.load(new FileInputStream("config/DBconfig.properties"));
} catch (IOException e) {
System.out.println(e.getMessage());
}
url = props.getProperty("url");
user = props.getProperty("user");
password = props.getProperty("password");
[...]
我做错了吗?
【问题讨论】:
标签: java eclipse tomcat filenotfoundexception