0
配置我的數據源:初始大小的BasicDataSource
<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財產都成爲被確定。爲什麼我會遇到這個問題?
您使用的是哪種版本的DBCP?在1.2中增加了'initialSize'。 –
我使用的是1.4版本 –