Issue 1:
Jon Anderson opened SPR-186 and commented

Attached is patch to Errors, EscapedErrors, and BindException that allows the nested path used for validation to be manipulated like a stack with a popNestedPath and a pushNestedPath methods.

Being able to nest forms together can save a lot of time and development effort. Nesting validators has the same effect. However, it's difficult to nest validators because the path used in errors needs to be set absolutely. So if a Validator makes use of a SubValidator for a portion of it's work, it might need to modify the nestedPath and return it to it's previous state before leaving the validate() method. For example. A PersonForm has a AddressForm, and is validated with a PersonValidator that makes use of a AddressValidator. The validate method for PersonValidator would be as follows:

public void validate() {

//other field validation here.

pushNestedPath("address");

addressValidator().validate();

popNestedPath();

}

This way the PersonForm can be nested into other forms, such as CompanyForm, ApplicationForm, etc, without code changes.

Attachments:

nestedPath.patch (2.86 kB)

Issue 2:
Alan Stewart (personal account) opened SPR-4683 and commented

Since upgrading from 2.5.2 to 2.5.3 I am getting a NullPointerException when attempting to load a org.springframework.context.support.ResourceBundleMessageSource in a context file that is imported by a parent context file, eg.

<beans ....

<import resource="classpath:applicationContext-core.xml" />

...

</beans>

where the "messageSource" bean is contained in the imported resource.

This did not happen with 2.5.2. After doing a search in the changelog for 2.5.3 here in JIRA, I can't seem to find an explanation why.

The following stack trace is generated on startup of the container:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource' defined in class path resource [applicationContext-core.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478)

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:217)

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:168)

at org.springframework.context.support.AbstractApplicationContext.initMessageSource(AbstractApplicationContext.java:628)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)

at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)

at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)

at au.com.woolworths.pap.server.PapTcpServer.main(PapTcpServer.java:82)

Caused by: java.lang.NullPointerException

at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.getCacheKey(AbstractAutoProxyCreator.java:322)

at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.predictBeanType(AbstractAutoProxyCreator.java:245)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:531)

at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1174)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:222)

at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:187)

at org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:73)

at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:98)

at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:84)

at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:66)

at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:345)

at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:309)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:361)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1342)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:471)

... 13 more

Alan

Affects: 2.5.3

Issue Links:

#9381 Use of factory-method caused application to fail in 2.5.3 but worked under all other previous 2.5 versions. ("is duplicated by")

3 votes, 2 watchers