我已使用我的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