action-servlet.xml 설정 후
Controller 에서 Service 메소드를 사용하기 위해서는 set() 메소드를 넣어주어야 함

# Controller.java 와 Service.java  동일한 방식으로 set()를 넣어줌

Controller.java

public class IncludeController implements Controller {

 protected final Log logger = LogFactory.getLog(getClass());

 private WritingHistoryService writingHistoryService;
 
 public void setWritingHistoryService(WritingHistoryService writingHistoryService) {
  this.writingHistoryService = writingHistoryService;
 }

List quickList = writingHistoryService.selectUserWritingViewInfo(userId, sessionId, 5);



########################## 에러 내용 #################################
정보: Initializing Spring FrameworkServlet 'action'
ERROR - FrameworkServlet.initServletBean(290) | Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'includeController' defined in ServletContext resource [/WEB-INF/conf/properties/action-servlet.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'writingHistoryService' of bean class [aaa.bbb.ccc.web.common.IncludeController]: Bean property 'writingHistoryService' 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:1279)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
 at java.security.AccessController.doPrivileged(Native Method)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
 at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
 at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
 at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
 at javax.servlet.GenericServlet.init(GenericServlet.java:212)
 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)
 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
 at org.apache.catalina.core.StandardService.start(StandardService.java:516)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'writingHistoryService' of bean class [aaa.bbb.ccc.web.common.IncludeController]: Bean property 'writingHistoryService' 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:801)
 at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:651)
 at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
 at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1276)
 ... 35 more


################# 에러내용 : Invalid property 'methodNameResolver'  #########################

action-servlet.xml , applicationContext-***.xml  설정후 methodNameResolver 에러 발생시

1) 해당하는 컨트롤러 클래스 상속 확인
MultiActionController 을 상속 받아야함.
public class ExpirationWriterController extends MultiActionController{

2) action-servlet.xml 확인
 <bean id="expirationWriterController" class="aa.bb.cc.web.expiration.ExpirationWriterController">
  <property name="expirationWriterService" ref="expirationWriterService" />
  <property name="methodNameResolver" ref="mappingMethodNameResolver" />
 </bean>

 <bean id="methodNameResolver" class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver">
  <property name="paramName">
   <value>method</value>
  </property>
  <property name="defaultMethodName">
   <value>list</value>
  </property>
 </bean>
 
 <bean id="mappingMethodNameResolver" class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver">
   <property name="mappings">
   <props>
    <prop key="/**/form.do">form</prop>
    <prop key="/**/read.do">view</prop>
    <prop key="/**/view.do">view</prop>
    <prop key="/**/modify.do">modify</prop>
    <prop key="/**/edit.do">modify</prop>
    <prop key="/**/list.do">list</prop>
    <prop key="/**/write.do">write</prop>
    <prop key="/**/save.do">save</prop>
    <prop key="/**/cancel.do">cancel</prop>
    <prop key="/**/regForm.do">regForm</prop>
    <prop key="/**/listView.do">listView</prop>
    <prop key="/**/detailView.do">detailView</prop>
    <prop key="/**/cancel.do">cancel</prop>
    <prop key="/**/success.do">success</prop>
    <prop key="/**/failure.do">failure</prop>
   </props>
  </property>  
 </bean>

####################   에러 내용 ######################
ERROR - FrameworkServlet.initServletBean(290) | Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'expirationWriterController' defined in ServletContext resource [/WEB-INF/conf/properties/action-servlet.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'methodNameResolver' of bean class [aaa.bbb.ccc.web.expiration.ExpirationWriterController]: Bean property 'methodNameResolver' 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:1279)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
 at java.security.AccessController.doPrivileged(Native Method)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
 at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
 at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
 at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
 at javax.servlet.GenericServlet.init(GenericServlet.java:212)
 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)
 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
 at org.apache.catalina.core.StandardService.start(StandardService.java:516)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'methodNameResolver' of bean class [aaa.bbb.ccc.web.expiration.ExpirationWriterController]: Bean property 'methodNameResolver' 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:801)
 at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:651)
 at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
 at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1276)
 ... 35 more

※ 위 내용은, 여러 자료를 참고하거나 제가 주관적으로 정리한 것입니다.
   잘못된 정보나 보완이 필요한 부분을, 댓글 또는 메일로 보내주시면 많은 도움이 되겠습니다.
04 5, 2009 14:16 04 5, 2009 14:16


Trackback URL : http://develop.sunshiny.co.kr/trackback/190

Leave a comment

« Previous : 1 : ... 504 : 505 : 506 : 507 : 508 : 509 : 510 : 511 : 512 : ... 648 : Next »

Recent Posts

  1. HDFS - Python Encoding 오류 처리
  2. HP - Vertica ROS Container 관련 오류...
  3. HDFS - Hive 실행시 System Time 오류
  4. HP - Vertica 사용자 쿼리 이력 테이블...
  5. Client에서 HDFS 환경의 데이터 처리시...

Recent Comments

  1. Generally I do not read post on bl... 레기읏룸 셔츠룸 차이. 레깅스룸 부엉이 01 24,
  2. Wonderful site. A lot of useful in... /427 01 23,
  3. 안녕하세요^^ 배그핵
  4. 안녕하세요^^ 도움이 되셨다니, 저... sunshiny
  5. 정말 큰 도움이 되었습니다.. 감사합... 사랑은

Recent Trackbacks

  1. important link important link %M
  2. invoice printing and mailing services invoice printing and mailing services %M
  3. my review here my review here %M
  4. relocation services london relocation services london %M
  5. get redirected here get redirected here 24 01

Calendar

«   01 2020   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Bookmarks

  1. 위키피디아
  2. MysqlKorea
  3. 오라클 클럽
  4. API - Java
  5. Apache Hadoop API
  6. Apache Software Foundation
  7. HDFS 생태계 솔루션
  8. DNSBL - Spam Database Lookup
  9. Ready System
  10. Solaris Freeware
  11. Linux-Site
  12. 윈디하나의 솔라나라

Site Stats

TOTAL 2823599 HIT
TODAY 464 HIT
YESTERDAY 543 HIT