我配置我的数据源:
<bean id ="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
<property name="url" value="jdbc:mysql:openshifturl"/>
<property name="username" value="username"/>
<property name="password" value="pass"/>
<property name="maxActive" value="10"/>
<property name="initialSize" value="5"/>
</bean>
并得到错误:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [EntityOperatorBean.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'initialSize' of bean class [org.apache.commons.dbcp.BasicDataSource]: Bean property 'initialSize' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
当我删除 initialSize 属性时,一切都可以了。为什么我会遇到这个问题?