2013-07-16 1 views
0

나는 나의은 dataSource 구성 :초기 크기 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? 

나는 모두가 OK로 될 initialSize가 속성 제거

. 왜이 문제가 생길까요?

+1

어떤 DBCP 버전을 사용하고 있습니까? 'initialSize'가 1.2에 추가되었습니다. –

+0

나는 1.4 버전 –

+0

\t을 사용하고 \t \t 평민 - DBCP \t \t \t \t \t \t 1.4 \t \t

답변

0

Pavel은 내 Tomcat Server가 dbcp 1.2에 이상한 종속성이 있음을 이해합니다. 이것은 처음에 dbcp 1.2에 대한 종속성을 생성했기 때문일 수 있습니다. 그리고 나중에 의존성을 1.4에 추가하면 작동하지 않습니다.

현재의 Tomcat 서버를 삭제하고 새 Tomcat 서버를 생성하여이 문제를 해결합니다. 급진적 인 방법이지만 내 문제를 해결합니다.

관련 문제