xrp_coil

2012년 5월 9일 수요일

@Autowired :: nested exception is org.springframework.beans.NotWritablePropertyException 해결.

아오.. 세팅하다가 이것때문에 무지 고생했네요.

다 허접한 실력때문이겠지만...ㅠㅠ

여튼 에러의 내용은 아래와 같습니다. 아래 색칠한 부분을 구글 번역기로 돌리면...

 클래스의 잘못된 부동산'loginDao'[com.kis.web.system.login.service.LoginService] :  재산'loginDao는'쓰기 아니거나 잘못된 세터 메소드를 가지고 있습니다.세터 매개 변수 타입은 게터의 반환 형식이 일치하는가?
라고 나옵니다..-_-;; 뭔소리야.. -_-^

짧은 영어실력으로 보자면 일단 getter와 setter 부분이 잘못되어서Bean을 만들수 없다는건데말이지요.. 해결을 하자면....

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'loginDao' of bean class [com.kis.web.system.login.service.LoginService]: Bean property 'loginDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1361) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'loginDao' of bean class [com.kis.web.system.login.service.LoginService]: Bean property 'loginDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1024) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:900) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1358) ... 21 more



applicationContext.xml 의 내용입니다.

<Bean id="loginDao"> 로 되어있습니다.

LoginService.java 의 내용입니다.

public void setUserDao(LoginDao loginDao) { 로 만들어져 있네요.

위 부분을 아래와 같이 맞춰줍니다.

public void setLoginDao(LoginDao loginDao) {

그리고 서버를 재시작..

잘돌아 갑니다.. 왜 이름을 다르게 했을까요..ㅠㅠ 버린시간이 너무 아깝네요.ㅠ


댓글 없음:

댓글 쓰기