为了账号安全,请及时绑定邮箱和手机立即绑定

问什么加载properties文件错误?

<!-- 引入外部文件:jdbc.properties -->

<context:property-placeholder location="classpath:jdbc.properties"/>

<!-- 配置连接池 -->

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">

<property name="driverClass" value="${jdbc.driverClass}"/>

<property name="url" value="${jdbc.url}"/>

<property name="user" value="${jdbc.username}"/>

<property name="password" value="${jdbc.password}"/>

</bean>

错入如下:

Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'url' of bean class [com.mchange.v2.c3p0.ComboPooledDataSource]: Bean property 'url' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?


Invalid property 'url' of bean class [com.mchange.v2.c3p0.ComboPooledDataSource]: Bean property 'url' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

正在回答

举报

0/150
提交
取消

问什么加载properties文件错误?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信