我已使用我的user.properties文件訪問存儲在WEB-INF文件夾中的數據庫。它在通過GGTS(Groovy Grail Tool Suite)運行時正常工作。在Apache Tomcat上部署時無法訪問屬性文件
我的DataSource
使用
Properties prop = new Properties();
prop.load(DataSource.class.getClassLoader().getResourceAsStream("user.properties"));
當我運行它作爲獨立
其工作但在創建它的戰爭文件,並將其部署到Tomcat服務器它不工作。
我的user.properties位於WEB-INF文件夾中。
顯示錯誤adavance
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
感謝。請幫助
爵士
WEB-INF/classes
文件夾,請立即告訴我,我有什麼關係? – Rahul 2013-03-08 18:01:03將文件移動到WEB-INF/classes,以便它位於類路徑中。 – 2013-03-08 18:02:24
先生,謝謝thanx很多你是偉大的....如果你有任何可以幫助我學習tomcat的博客,請參閱我新的感謝。 – Rahul 2013-03-08 18:16:03