이 누리집은 대한민국 공식 전자정부 누리집입니다.
정*선
2010-12-24 16:21:10
3,340
실행환경
완료
다른 분 질문에 대한 답변 내용처럼 했는데 ㅠㅠ
다중 DB라 첨부한 파일을 보시면 아시겠지만 context-datasource에 두 개의 datasource를 설정하구 context-sqlMap.xml을 다른 이름으로 하나 추가한 후 새로운Dao도 생성했는데 아래와 같은 오류가 발생합니다.
제 개인적인 생각으로는 SqlMapClientFactoryBean에는 dataSource라는 필드만 있지 새로운 id인 smsDataSoruce라는 필드가 없어서 오류가 나는 것 같은데 해결 방법이 없을까요?
아래는 오류 메시지입니다.
Error creating bean with name 'tbSmsInfoDAO': Injection of resource methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'smsSqlMapClient' defined in file [D:\kemco\workspace\tmss\target\classes\egovframework\spring\context-sqlMap-sms.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'smsDataSource' of bean class [org.springframework.orm.ibatis.SqlMapClientFactoryBean]: Bean property 'smsDataSource' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
환경.zip [17,521 Byte]
다운로드
안녕하세요.. 정영선님..
context-sqlMap-sms.xml의 smsSqlMapClient의 속성에 사용된 이름(smsDataSource) 때문입니다.
다음과 같이 수정 (smsDataSource => dataSource)하시면 됩니다.
<bean id="smsSqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="classpath:/egovframework/sqlmap/rte/sql-map-config.xml"/>
<property name="dataSource" ref="smsDataSource"/>
</bean>
그럼.. 즐거운 하루되십시오.
감사합니다.