Issue 1:
Mike Youngstrom opened SPR-4372 and commented

I would like to do some custom operations when scanning for components which has lead me to wish for some additional extension points the Spring Component Scanning.

It would be nice if there were some sort of way to manipulate each BeanDefinitions found in ClassPathBeanDefinitionScanner.doScan prior to them being registered. A simple protected callback method would be sufficient for my needs.

Provide some way to specify a custom ClassPathBeanDefinitionScanner in ComponentScanBeanDefinitionParser so that in order to use my custom ClassPathBeanDefinitionScanner I won't have to completely re-implement ComponentScanBeanDefinitionParser.parse()

Thoughts?

Mike

Affects: 2.5.1

Issue 2:
Daniel Rubio opened SPR-6082 and commented

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.

Affects: 3.0 M4

Issue Links:

#10738 Differing types for getter/setter of CookieGenerator.cookieMaxAge causes configuring to fail. ("duplicates")