You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Gandalf0777 <go...@o2.pl> on 2008/09/11 10:49:43 UTC

Collections LazyList spring mvc problem

Hi,

I have a strange problem with a LazyList and spring mvc form.

When I'm adding a new object of the main class - everything is ok. I may add
many objects via a Javascript to my sublist and everything is ok.

Problem is when I try to update a main class object with new objects in the
sublist.

Here is the main class object fragment with a lazyList:

private List<OtherWorkElement> elements = LazyList.decorate(
	new ArrayList<OtherWorkElement>(),
	FactoryUtils.instantiateFactory(OtherWorkElement.class));

When I update a main object with a new object in the lazy sublist I get an
exception:

[CODE]SEVERE: Servlet.service() for servlet dispatcher threw exception
java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
	at java.util.ArrayList.RangeCheck(Unknown Source)
	at java.util.ArrayList.get(Unknown Source)
	at org.hibernate.collection.PersistentBag.get(PersistentBag.java:423)
	at
org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:566)
	at
org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:451)
	at
org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:428)
	at
org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:645)
	at
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
	at
org.springframework.validation.DataBinder.applyPropertyValues(DataBinder.java:532)
	at org.springframework.validation.DataBinder.doBind(DataBinder.java:434)
	at
org.springframework.web.bind.WebDataBinder.doBind(WebDataBinder.java:147)[/CODE]

Strange is that according to a stack trace the problem is in get method of
an ArrayList class (instead of LazyList class' get method). I don't
understand that :(
If anybody could say a word...

Regards,
Gandalf
-- 
View this message in context: http://www.nabble.com/Collections-LazyList-spring-mvc-problem-tp19430511p19430511.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org