org.springframework.beans.NotWritablePropertyException: Invalid property 'cookieMaxAge' of bean class [org.springframework.web.servlet.i18n.CookieLocaleResolver]: Bean property 'cookieMaxAge' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

Spring JIRA | Daniel Rubio | 7 years ago
  1. 0

    upgrading a functioning 2.5 app to the most recent 3.0 (M4) release. I have the following bean definition that fails in 3.0 M4: <bean id="localeResolver"^M class="org.springframework.web.servlet.i18n.CookieLocaleResolver">^M <property name="cookieName" value="language" />^M <property name="cookieMaxAge" value="3600" />^M <property name="defaultLocale" value="en" />^M </bean> When I deploy this in Tomcat 6.20 I get the following error. SEVERE: Allocate exception for servlet court org.springframework.beans.NotWritablePropertyException: Invalid property 'cookieMaxAge' of bean class [org.springframework.web.servlet.i18n.CookieLocaleResolver]: Bean property 'cookieMaxAge' 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:850) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:701) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:60) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1330) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1060) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:449) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:289) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:286) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:188) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:528) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:716) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:447) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:342) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:308) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) I reviewed the docs on M4 http://static.springsource.org/spring/docs/3.0.0.M4/javadoc-api/org/springframework/web/servlet/i18n/CookieLocaleResolver.html The method is inherited from org.springframework.web.util.CookieGenerator . I saw the source https://src.springframework.org/svn/spring-framework/tags/spring-framework-3.0.0.M4/org.springframework.web/src/main/java/org/springframework/web/util/CookieGenerator.java And the set and getCookieMaxAge methods appears to be there. Not exactly sure what is the root of this error message/bug.

    Spring JIRA | 7 years ago | Daniel Rubio
    org.springframework.beans.NotWritablePropertyException: Invalid property 'cookieMaxAge' of bean class [org.springframework.web.servlet.i18n.CookieLocaleResolver]: Bean property 'cookieMaxAge' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
  2. 0

    upgrading a functioning 2.5 app to the most recent 3.0 (M4) release. I have the following bean definition that fails in 3.0 M4: <bean id="localeResolver"^M class="org.springframework.web.servlet.i18n.CookieLocaleResolver">^M <property name="cookieName" value="language" />^M <property name="cookieMaxAge" value="3600" />^M <property name="defaultLocale" value="en" />^M </bean> When I deploy this in Tomcat 6.20 I get the following error. SEVERE: Allocate exception for servlet court org.springframework.beans.NotWritablePropertyException: Invalid property 'cookieMaxAge' of bean class [org.springframework.web.servlet.i18n.CookieLocaleResolver]: Bean property 'cookieMaxAge' 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:850) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:701) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:60) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1330) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1060) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:449) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:289) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:286) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:188) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:528) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:716) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:447) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:342) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:308) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) I reviewed the docs on M4 http://static.springsource.org/spring/docs/3.0.0.M4/javadoc-api/org/springframework/web/servlet/i18n/CookieLocaleResolver.html The method is inherited from org.springframework.web.util.CookieGenerator . I saw the source https://src.springframework.org/svn/spring-framework/tags/spring-framework-3.0.0.M4/org.springframework.web/src/main/java/org/springframework/web/util/CookieGenerator.java And the set and getCookieMaxAge methods appears to be there. Not exactly sure what is the root of this error message/bug.

    Spring JIRA | 7 years ago | Daniel Rubio
    org.springframework.beans.NotWritablePropertyException: Invalid property 'cookieMaxAge' of bean class [org.springframework.web.servlet.i18n.CookieLocaleResolver]: Bean property 'cookieMaxAge' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
  3. 0

    Tomcat cannot start

    Stack Overflow | 5 years ago | sone
    org.springframework.beans.NotWritablePropertyException: Invalid property 'filters' of bean class [org.directwebremoting.spring.SpringConfigurator]: Bean property 'filters' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'powerAction'

    verydemo.com | 1 year ago
    org.springframework.beans.NotWritablePropertyException: Invalid property 'MoPowerManagerDAO' of bean class [com.rainmon.pm.action.MoPowerManagerAction]: Bean property 'MoPowerManagerDAO' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
  6. 0

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name powerAction —核心网络

    netfoucs.com | 9 months ago
    org.springframework.beans.NotWritablePropertyException: Invalid property 'MoPowerManagerDAO' of bean class [com.rainmon.pm.action.MoPowerManagerAction]: Bean property 'MoPowerManagerDAO' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

    4 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.beans.NotWritablePropertyException

      Invalid property 'cookieMaxAge' of bean class [org.springframework.web.servlet.i18n.CookieLocaleResolver]: Bean property 'cookieMaxAge' 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()
    2. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:850)
      2. org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:701)
      3. org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
      4. org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:60)
      5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1330)
      6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1060)
      7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
      8. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:449)
      9. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:289)
      10. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      11. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:286)
      12. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:188)
      13. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:528)
      13 frames
    3. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:716)
      2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383)
      2 frames
    4. Spring MVC
      HttpServletBean.init
      1. org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:447)
      2. org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:342)
      3. org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:308)
      4. org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
      4 frames
    5. JavaServlet
      GenericServlet.init
      1. javax.servlet.GenericServlet.init(GenericServlet.java:212)
      1 frame
    6. Glassfish Core
      StandardEngineValve.invoke
      1. org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
      2. org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      5. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      6. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      7. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      7 frames