Spring 中利用文件加载方式配置数据源

今天要做单元测试,于是在spring中配置proxool的数据源,但是就是报错,原因是因为我把

<!-- 加载jdbc配置 -->
<context:property-placeholder location="classpath:config/jdbc.properties" />

的位置放错地方了,我放在了

<!-- 加载定时作业配置 -->
<util:properties id="schduleProps" location="classpath:task.properties" />
<context:property-placeholder properties-ref="schduleProps" />

的后面,后来修改了一下就好了

<!-- 基于注解的根包扫描路径 -->
<context:component-scan base-package="com.cfuture.justeasy.web" />

<!-- 加载jdbc配置 -->
<context:property-placeholder location="classpath:config/jdbc.properties" />

<!-- 加载定时作业配置 -->
<util:properties id="schduleProps" location="classpath:task.properties" />
<context:property-placeholder properties-ref="schduleProps" />

posted @ 2013-12-18 17:00  andysd  阅读(262)  评论(0)    收藏  举报