Thursday, 1 September 2016

org.springframework.beans.InvalidPropertyException: Invalid property Index of out of bounds in property path ~ gniithelp

When we add dynamically adding table rows and columns via javascript and trying to binding to the spring path variable it throws InvalidPropertyException: stating that 
Index: 1, Size: 1

org.springframework.beans.InvalidPropertyException: Invalid property 'intnlTrnsVORcvlist[1]' of bean class [com.citi.aml.cadd.webapp.accountprofileform.Accou
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:585)
at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:415)
at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:392)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:597)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValue(AbstractPropertyAccessor.java:49)
Truncated. see log file for complete stacktrace
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:534)
at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:415)
at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:392)
Truncated. see log file for complete stacktrace
>


Solution is
Instead of ArrayList of VO class. use GrowList.decorate(ArrayList .. along with VO class.

Example

Instead of List rcvnewList = new ArrayList(WireCountryVO.class);

Use this
List rcvnewList =GrowthList.decorate(LazyList.decorate(new
ArrayList(),FactoryUtils.instantiateFactory(WireCountryVO.class)));

No comments:

Post a Comment