Invalid bean definition with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring/base.xml]: Could not resolve placeholder 'jdbc.driver'这个问题一直解决不了,里面的配置是正确的,但是还一直报这个错,重新从svn下拉取项目还是这样。什么原因这个是配置
最好把配置贴出来,目测是jdbc.driver这个占位符找不到,也就是说在属性文件中没有这个属性配置,检查一下jdbc.properties
属性配置文件没有添加到这个配置文件中,引入配置文件。修正代码:(具体是你的配置文件的路径,对着修正即可)
<!-- 引入jdbc配置文件 -->
<context:property-placeholder location="classpath:jdbc.properties" />
bean.xml中是否有配置属性文件配置:
class="org.springframework.beans.factory.config.
PropertyPlaceholderConfigurer">
jdbc.properties
或者是:
jdbc.properties替换成你项目中这个文件的类路径
应该是数据库配置文件没引入,在bean.xml加上如下配置:
<context:property-placeholder location="classpath:jdbc.properties" />
或者是:
<bean id="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:jdbc.properties</value>
</list>
</property>
</bean>
把jdbc.properties换成你项目中配置文件的类路径