It IS very possible I am going about this from the completely wrong angle...
The gist of it is, that a whole bunch of users will be reading all the
entries from the same vector in an asynchronised manner. So what I thought
that each user would require their own Iterator to keep track of their
progress through the Vector ...
The only actions I performed on the vector is adding to it. I am thinking,
once the iterator is retrieved from getItemModels() does RefreshingView
store the iterator within itself for the duration that its being displayed?
cause if that is the case, i am thinking i dont even NEED to be storing the
iterator with each user!
igor.vaynberg wrote:
>
> On 7/18/07, Ballist1c <[EMAIL PROTECTED]> wrote:
>>
>>
>> Yep, I made some adjustments to code, to allow for any number of users to
>> join a chatSession, rather then just 2.
>>
>> What I am doing is , the vector that I am using is within a particular
>> class
>> and the Iterators for that vector are actually stored within another
>> subclass which is stored within a hashmap within this class.
>
>
> w o w
>
> I got this working before with Iterators directly declared within the
> class,
>> but now that I have moved the iterators to a hashMap so I can store
>> multiple
>> iterators to the same Vector, it has gone nuts... with the same error:(
>>
>> Anyway, let me know what you think
>
>
> obviously whatever this thing is, another thread is modifying it, or you
> are doing something elsewhere to modify it.
>
> what you should do is instead of returning an iterator directly first copy
> the values into an array list and return an iterator to that. java 101.
>
> -igor
>
>
>
> ----------------------------------------------------------------------------------
>> chatRefreshingView = new RefreshingView("chatView", new
>> PropertyModel(new PropertyModel(ChatView.this.getJumbuckSession(),
>> "currentChatSession"), "chatEntries"))
>> {
>> protected Iterator getItemModels()
>> {
>> //i like cereal
>> chatViewItemsIterator = new
>> ModelIteratorAdapter(ChatView.this.getJumbuckSession
>> ().getCurrentChatSessionIterator())
>> {
>>
>> protected IModel model(Object object) {
>> return new Model((Serializable) object);
>> }
>> };
>> return chatViewItemsIterator;
>> }
>> protected void populateItem(Item item)
>> {
>> ChatViewItem chatViewItem = getItem("chatViewItem");
>> item.add(chatViewItem);
>> chatViewItem.setMyModels();
>> }
>> };
>>
>> add(chatRefreshingView);
>> chatRefreshingView.setOutputMarkupId(true);
>>
>>
>> -------------------------------------------------------------------------------
>> public void setMyModels() //for chatViewItem.setMyModels() above
>> {
>>
>> IModel chatViewItemModel = getParent().getModel();
>> PropertyModel contentsModel = new
>> PropertyModel(chatViewItemModel,
>> "contents");
>>
>> getAuthorChatImage().setModel(new ImagePathFromIdModel(new
>> PropertyModel(chatViewItemModel, "authorProfileId")));
>> getContents().setModel(contentsModel);
>> }
>>
>>
>> ----------------------------------------------------------------------------------
>>
>> WicketMessage: Error attaching this container for rendering:
>> [MarkupContainer [Component id = chatDisplay, page =
>> jumbuck.ffweb.wicket.page.FFWeb, path =
>> 0:main_tabbed_panel:target_panel:tabbed_panel:target_panel:
>> chatDisplay.HotListTargetPanel$1,
>> isVisible = true, isVersioned = false]]
>>
>> Root cause:
>>
>> java.util.ConcurrentModificationException
>> at java.util.AbstractList$Itr.checkForComodification(AbstractList.java
>> :372)
>> at java.util.AbstractList$Itr.next(AbstractList.java:343)
>> at
>> org.apache.wicket.markup.repeater.util.ModelIteratorAdapter.next(
>> ModelIteratorAdapter.java:60)
>> at
>> org.apache.wicket.markup.repeater.DefaultItemReuseStrategy$1.next(
>> DefaultItemReuseStrategy.java:71)
>> at
>> org.apache.wicket.markup.repeater.RefreshingView.addItems(
>> RefreshingView.java:189)
>> at
>> org.apache.wicket.markup.repeater.RefreshingView.onBeforeRender(
>> RefreshingView.java:115)
>> at org.apache.wicket.Component.beforeRender(Component.java:846)
>> at
>> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(
>> MarkupContainer.java:1449)
>> at org.apache.wicket.Component.beforeRender(Component.java:856)
>> at
>> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(
>> MarkupContainer.java:1449)
>> at org.apache.wicket.Component.beforeRender(Component.java:856)
>> at
>> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(
>> MarkupContainer.java:1449)
>> at org.apache.wicket.Component.beforeRender(Component.java:856)
>> at
>> org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(
>> AjaxRequestTarget.java:757)
>> at
>> org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(
>> AjaxRequestTarget.java:662)
>> at
>> org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java
>> :520)
>> at
>> org.apache.wicket.request.AbstractRequestCycleProcessor.respond(
>> AbstractRequestCycleProcessor.java:103)
>> at
>> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java
>> :1037)
>> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1107)
>> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1176)
>> at org.apache.wicket.RequestCycle.request(RequestCycle.java:499)
>> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java
>> :257)
>> at
>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java
>> :127)
>> --
>> View this message in context:
>> http://www.nabble.com/java.util.ConcurrentModificationException-with-RefreshingView-%28AGAIN%21-%21-%21%21%29-tf4101508.html#a11663707
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>> _______________________________________________
>> Wicket-user mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
--
View this message in context:
http://www.nabble.com/java.util.ConcurrentModificationException-with-RefreshingView-%28AGAIN%21-%21-%21%21%29-tf4101508.html#a11680094
Sent from the Wicket - User mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user