日期:2014-05-18  浏览次数:20936 次

Spring 中配置 jdbc.properties 问题!
我在Spring中配置 jdbc.properties  但总报 找不到该文件
报错信息
INFO - Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
INFO - SQLErrorCodes loaded: [DB2, HSQL, MS-SQL, MySQL, Oracle, Informix, PostgreSQL, Sybase]
Hibernate: select user0_.id as id, user0_.user_cname as user2_4_, user0_.user_spellname as user3_4_, user0_.user_password as user4_4_, user0_.user_role as user5_4_, user0_.user_whichtechnic as user6_4_, user0_.projectId as projectId4_, user0_.projectName as projectN8_4_, user0_.deleted as deleted4_, user0_.last_updatedate as last10_4_, user0_.last_updatetime as last11_4_ from user user0_ where user0_.user_spellname=? and user0_.user_password=?
INFO - Loading XML bean definitions from file [C:\Tomcat 5.5\webapps\YW\WEB-INF\applicationContext.xml]
INFO - Bean factory for application context [org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=23141412]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertyConfigurer,YW_DataSource,sessionFactory,UserDAO,/login,ProjectDAO,/project,/account,TaskDAO,/task,ModuleDAO,/module]; root of BeanFactory hierarchy
INFO - 12 beans defined in application context [org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=23141412]
INFO - Loading properties file from file [C:\Tomcat 5.5\bin\WEB-INF\jdbc.properties]
WARN - Unhandled Exception thrown: class org.springframework.beans.factory.BeanInitializationException
ERROR - Servlet.service() for servlet action threw exception
org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: WEB-INF\jdbc.properties (系统找不到指定的路径。)
java.io.FileNotFoundException: WEB-INF\jdbc.properties (系统找不到指定的路径。)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.springframework.core.io.FileSystemResource.getInputStream(FileSystemResource.java:85)
at org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:183)
at org.springframework.core.io.support.PropertiesLoaderSupport.mergeProperties(PropertiesLoaderSupport.java:162)
at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:69)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:373)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:295)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:89)
at org.springframework.context.support.FileSystemXmlAppl