You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by saty <sa...@gmail.com> on 2013/07/15 17:55:02 UTC

How to resolve this java.util.ConcurrentModificationException

Getting below error at times, looks like its coming from usage of apache
common LRUMAa class, not sure where to start fixing this. 

15 Jul 2013 11:03:42.099 [http-apr-9999-exec-3] ERROR
o.a.w.serialize.java.JavaSerializer - error writing object [Page class =
com.abc.xyz.web.HomePage, id = 5, render count = 6]: null
java.util.ConcurrentModificationException: null
	at
org.apache.commons.collections.map.AbstractLinkedMap$LinkIterator.nextEntry(AbstractLinkedMap.java:560)
~[commons-collections-3.2.1.jar:3.2.1]
	at
org.apache.commons.collections.map.AbstractLinkedMap$LinkMapIterator.next(AbstractLinkedMap.java:372)
~[commons-collections-3.2.1.jar:3.2.1]
	at
org.apache.commons.collections.map.AbstractHashedMap.doWriteObject(AbstractHashedMap.java:1181)
~[commons-collections-3.2.1.jar:3.2.1]
	at org.apache.commons.collections.map.LRUMap.doWriteObject(LRUMap.java:420)
~[commons-collections-3.2.1.jar:3.2.1]
	at org.apache.commons.collections.map.LRUMap.writeObject(LRUMap.java:404)
~[commons-collections-3.2.1.jar:3.2.1]
	at sun.reflect.GeneratedMethodAccessor130.invoke(Unknown Source) ~[na:na]
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.7.0_21]
	at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_21]
	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:975)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
[na:1.7.0_21]
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
[na:1.7.0_21]
	at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
[na:1.7.0_21]
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
[na:1.7.0_21]

Thanks for your help.




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-this-java-util-ConcurrentModificationException-tp4660273.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to resolve this java.util.ConcurrentModificationException

Posted by saty <sa...@gmail.com>.
Ok, thank you all.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-this-java-util-ConcurrentModificationException-tp4660273p4660734.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to resolve this java.util.ConcurrentModificationException

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Wicket 6.x has org.apache.wicket.core.util.objects.checker.IObjectChecker.
You may create your own one that doesn't allow serialization of LRUMap.
When such object is passed to ObjectOutputStream it will throw an exception
with nice message explaining the reference to this LRUMap.
This way you should be able to find which page keeps a ref to the LRUMap
See org.apache.wicket.serialize.java.JavaSerializer.SerializationCheckerObjectOutputStream#writeObjectOverride
for an example how to add your checker


On Tue, Aug 6, 2013 at 8:03 PM, saty <sa...@gmail.com> wrote:

> Ok.. To explain the scenario, i have a singleton data-maanger java class
> that
> user a underlying LRUMAP to store most recently viewed data. various wicket
> panels use this data-manager to request data that they need to
> display/update etc.
> Access to data is well protected using various synchronization techniques
> and have no problem in that. The problem seems to be, is somehow wicket is
> trying to serialize this LRUMAP which conflicts with application wring data
> to it at that same time.
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-this-java-util-ConcurrentModificationException-tp4660273p4660730.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to resolve this java.util.ConcurrentModificationException

Posted by Michael Mosmann <mi...@mosmann.de>.
Am 06.08.13 20:03, schrieb saty:
> ...various wicket
> panels use this data-manager to request data that they need to
> display/update etc.
I think it matters how you acces this data-manager from your panels. If 
you use something like this:

Application.get().dataManager().doSomething(bla)

you should not have any problems like that. So I think you are holding a 
reference to the data-manager as a field in your panel. This way its 
part of the object and will be serialized.

You can put this kind of stuff in an LDM an overwrite the load()-method with

Application.get().dataManager().doSomething(bla)

This way your panel can use this model like any other model.
>   
> Access to data is well protected using various synchronization techniques
> and have no problem in that. The problem seems to be, is somehow wicket is
> trying to serialize this LRUMAP which conflicts with application wring data
> to it at that same time.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-this-java-util-ConcurrentModificationException-tp4660273p4660730.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to resolve this java.util.ConcurrentModificationException

Posted by saty <sa...@gmail.com>.
Ok.. To explain the scenario, i have a singleton data-maanger java class that
user a underlying LRUMAP to store most recently viewed data. various wicket
panels use this data-manager to request data that they need to
display/update etc. 
Access to data is well protected using various synchronization techniques
and have no problem in that. The problem seems to be, is somehow wicket is
trying to serialize this LRUMAP which conflicts with application wring data
to it at that same time. 



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-this-java-util-ConcurrentModificationException-tp4660273p4660730.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to resolve this java.util.ConcurrentModificationException

Posted by Dan Retzlaff <dr...@gmail.com>.
I'd use a debugger to look for live references to the map. In Eclipse, if
you right-click the variable line in the Variables view, there is an All
References option. The trick is instantiating the offending Wicket
component to create the reference. But once created it should stick around
at least until the next GC.

Dan


On Tue, Aug 6, 2013 at 9:27 AM, Michael Mosmann <mi...@mosmann.de> wrote:

> IMHO nothing in Application is serialized. But its far to easy to leak an
> instance of this LRU-Map into some components (anon classes).
>
> Can you provide some code or error message?
>
> Am 06.08.13 18:22, schrieb saty:
>
>  I need to understand what and when Wicket tries to serialize stuff in a
>> running wicket application. I am not able to fix this error and it keeps
>> growing with more users starting to use the application. It does not
>> affect
>> the application usage but it keeps beaming error email.
>>
>> I am using LRU map to cache certain data being used in the application and
>> that is a shared data in a static context not tied to any particular user.
>> Why would wicket try to serialize this object, this should not be
>> serialized
>> at all. LRU map this is not synchronized and is not thread-safe and
>> application code treats it that way but the serialization keeps generating
>> concurrent modification exception as its obvious its trying to serialize
>> this when something changes the map.
>> if i declare this as transient, will this prevent wicket from serializing
>> this map too, what are the possible repercussion in wicket application if
>> i
>> declare this transient.
>>
>> Thanks for your help.
>>
>>
>>
>> --
>> View this message in context: http://apache-wicket.1842946.**
>> n4.nabble.com/How-to-resolve-**this-java-util-**
>> ConcurrentModificationExceptio**n-tp4660273p4660725.html<http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-this-java-util-ConcurrentModificationException-tp4660273p4660725.html>
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to resolve this java.util.ConcurrentModificationException

Posted by Dan Retzlaff <dr...@gmail.com>.
There isn't much information in that stack. Why don't you subclass LRUMap
with a custom writeObject() implementation? Then you can breakpoint it, log
from it, and maybe throw NotSerializableException to trigger Wicket
SerializableChecker which gives nicer output. That way it triggers every
time the map is serialized, not just when a concurrent modification happens.


On Tue, Aug 6, 2013 at 10:52 AM, saty <sa...@gmail.com> wrote:

> Thanks Mike,
>
> This is the complete exception trace, thanks for your help. It does appear
> that this is thrown when wicket trying to serialize page.
>
>
> 06 Aug 2013 13:30:20.917 [http-apr-9999-exec-3] ERROR
> o.a.w.serialize.java.JavaSerializer - Error serializing object class
> com.a.b.web.HomePage [object=[Page class = com.a.b.web.HomePage, id = 0,
> render count = 1]]
> org.apache.wicket.WicketRuntimeException:
> java.util.ConcurrentModificationException
>         at
>
> org.apache.wicket.serialize.java.JavaSerializer$SerializationCheckerObjectOutputStream.writeObjectOverride(JavaSerializer.java:278)
> ~[wicket-core-6.6.0.jar:6.6.0]
>         at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:342)
> ~[na:1.7.0_21]
>         at
>
> org.apache.wicket.serialize.java.JavaSerializer.serialize(JavaSerializer.java:78)
> ~[wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.pageStore.DefaultPageStore.serializePage(DefaultPageStore.java:376)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:150)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.storeTouchedPages(PageStoreManager.java:383)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:171)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.page.AbstractPageManager.commitRequest(AbstractPageManager.java:98)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.page.PageManagerDecorator.commitRequest(PageManagerDecorator.java:73)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.page.PageAccessSynchronizer$2.commitRequest(PageAccessSynchronizer.java:281)
> [wicket-core-6.6.0.jar:6.6.0]
>         at org.apache.wicket.Application$2.onDetach(Application.java:1628)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:105)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:101)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.util.listener.ListenerCollection$1.notify(ListenerCollection.java:120)
> [wicket-util-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.util.listener.ListenerCollection.reversedNotify(ListenerCollection.java:144)
> [wicket-util-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.util.listener.ListenerCollection.reversedNotifyIgnoringExceptions(ListenerCollection.java:113)
> [wicket-util-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.request.cycle.RequestCycleListenerCollection.onDetach(RequestCycleListenerCollection.java:100)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.request.cycle.RequestCycle.onDetach(RequestCycle.java:619)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
> org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:568)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:286)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:244)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:267)
> [wicket-core-6.6.0.jar:6.6.0]
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.39]
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.39]
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:344)
> [spring-security-web-3.0.0.M2.jar:na]
>         at
>
> org.springframework.security.ui.ntlm.NtlmProcessingFilter.doFilter(NtlmProcessingFilter.java:355)
> [spring-security-ntlm-3.0.0.M2.jar:na]
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
> [spring-security-web-3.0.0.M2.jar:na]
>         at
>
> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:98)
> [spring-security-web-3.0.0.M2.jar:na]
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
> [spring-security-web-3.0.0.M2.jar:na]
>         at
>
> org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
> [spring-security-web-3.0.0.M2.jar:na]
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
> [spring-security-web-3.0.0.M2.jar:na]
>         at
>
> org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:150)
> [spring-security-web-3.0.0.M2.jar:na]
>         at
>
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
> [spring-web-3.0.2.RELEASE.jar:3.0.2.RELEASE]
>         at
>
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
> [spring-web-3.0.2.RELEASE.jar:3.0.2.RELEASE]
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.39]
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.39]
>         at
>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
> [catalina.jar:7.0.39]
>         at
>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
> [catalina.jar:7.0.39]
>         at
>
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
> [catalina.jar:7.0.39]
>         at
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
> [catalina.jar:7.0.39]
>         at
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
> [catalina.jar:7.0.39]
>         at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947)
> [catalina.jar:7.0.39]
>         at
>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> [catalina.jar:7.0.39]
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
> [catalina.jar:7.0.39]
>         at
>
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
> [tomcat-coyote.jar:7.0.39]
>         at
>
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
> [tomcat-coyote.jar:7.0.39]
>         at
>
> org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
> [tomcat-coyote.jar:7.0.39]
>         at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> [na:1.7.0_21]
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> [na:1.7.0_21]
>         at java.lang.Thread.run(Thread.java:722) [na:1.7.0_21] Caused by:
> java.util.ConcurrentModificationException: null
>         at
>
> org.apache.commons.collections.map.AbstractLinkedMap$LinkIterator.nextEntry(AbstractLinkedMap.java:560)
> ~[commons-collections-3.2.1.jar:3.2.1]
>         at
>
> org.apache.commons.collections.map.AbstractLinkedMap$LinkMapIterator.next(AbstractLinkedMap.java:372)
> ~[commons-collections-3.2.1.jar:3.2.1]
>         at
>
> org.apache.commons.collections.map.AbstractHashedMap.doWriteObject(AbstractHashedMap.java:1181)
> ~[commons-collections-3.2.1.jar:3.2.1]
>         at
> org.apache.commons.collections.map.LRUMap.doWriteObject(LRUMap.java:420)
> ~[commons-collections-3.2.1.jar:3.2.1]
>         at
> org.apache.commons.collections.map.LRUMap.writeObject(LRUMap.java:404)
> ~[commons-collections-3.2.1.jar:3.2.1]
>         at sun.reflect.GeneratedMethodAccessor156.invoke(Unknown Source)
> ~[na:na]
>         at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> ~[na:1.7.0_21]
>         at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_21]
>         at
> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:975)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
> ~[na:1.7.0_21]
>         at
>
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
> ~[na:1.7.0_21]
>         at
>
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
> ~[na:1.7.0_21]
>         at
>
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
> ~[na:1.7.0_21]
>         at
>
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
> ~[na:1.7.0_21]
>         at
>
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
> ~[na:1.7.0_21]
>         at
>
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
> ~[na:1.7.0_21]
>         at
>
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
> ~[na:1.7.0_21]
>         at
>
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
> ~[na:1.7.0_21]
>         at
>
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
> ~[na:1.7.0_21]
>         at
>
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
> ~[na:1.7.0_21]
>         at
>
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
> ~[na:1.7.0_21]
>         at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
> ~[na:1.7.0_21]
>         at
>
> org.apache.wicket.serialize.java.JavaSerializer$SerializationCheckerObjectOutputStream.writeObjectOverride(JavaSerializer.java:260)
> ~[wicket-core-6.6.0.jar:6.6.0]
>         ... 50 common frames omitted
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-this-java-util-ConcurrentModificationException-tp4660273p4660729.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to resolve this java.util.ConcurrentModificationException

Posted by saty <sa...@gmail.com>.
Thanks Mike,

This is the complete exception trace, thanks for your help. It does appear
that this is thrown when wicket trying to serialize page.


06 Aug 2013 13:30:20.917 [http-apr-9999-exec-3] ERROR
o.a.w.serialize.java.JavaSerializer - Error serializing object class
com.a.b.web.HomePage [object=[Page class = com.a.b.web.HomePage, id = 0,
render count = 1]]
org.apache.wicket.WicketRuntimeException:
java.util.ConcurrentModificationException
	at
org.apache.wicket.serialize.java.JavaSerializer$SerializationCheckerObjectOutputStream.writeObjectOverride(JavaSerializer.java:278)
~[wicket-core-6.6.0.jar:6.6.0]
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:342)
~[na:1.7.0_21]
	at
org.apache.wicket.serialize.java.JavaSerializer.serialize(JavaSerializer.java:78)
~[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.pageStore.DefaultPageStore.serializePage(DefaultPageStore.java:376)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:150)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.storeTouchedPages(PageStoreManager.java:383)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:171)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.page.AbstractPageManager.commitRequest(AbstractPageManager.java:98)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.page.PageManagerDecorator.commitRequest(PageManagerDecorator.java:73)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.page.PageAccessSynchronizer$2.commitRequest(PageAccessSynchronizer.java:281)
[wicket-core-6.6.0.jar:6.6.0]
	at org.apache.wicket.Application$2.onDetach(Application.java:1628)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:105)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:101)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.util.listener.ListenerCollection$1.notify(ListenerCollection.java:120)
[wicket-util-6.6.0.jar:6.6.0]
	at
org.apache.wicket.util.listener.ListenerCollection.reversedNotify(ListenerCollection.java:144)
[wicket-util-6.6.0.jar:6.6.0]
	at
org.apache.wicket.util.listener.ListenerCollection.reversedNotifyIgnoringExceptions(ListenerCollection.java:113)
[wicket-util-6.6.0.jar:6.6.0]
	at
org.apache.wicket.request.cycle.RequestCycleListenerCollection.onDetach(RequestCycleListenerCollection.java:100)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.request.cycle.RequestCycle.onDetach(RequestCycle.java:619)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:568)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:286)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:244)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:267)
[wicket-core-6.6.0.jar:6.6.0]
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
[catalina.jar:7.0.39]
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
[catalina.jar:7.0.39]
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:344)
[spring-security-web-3.0.0.M2.jar:na]
	at
org.springframework.security.ui.ntlm.NtlmProcessingFilter.doFilter(NtlmProcessingFilter.java:355)
[spring-security-ntlm-3.0.0.M2.jar:na]
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
[spring-security-web-3.0.0.M2.jar:na]
	at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:98)
[spring-security-web-3.0.0.M2.jar:na]
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
[spring-security-web-3.0.0.M2.jar:na]
	at
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
[spring-security-web-3.0.0.M2.jar:na]
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
[spring-security-web-3.0.0.M2.jar:na]
	at
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:150)
[spring-security-web-3.0.0.M2.jar:na]
	at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
[spring-web-3.0.2.RELEASE.jar:3.0.2.RELEASE]
	at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
[spring-web-3.0.2.RELEASE.jar:3.0.2.RELEASE]
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
[catalina.jar:7.0.39]
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
[catalina.jar:7.0.39]
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
[catalina.jar:7.0.39]
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
[catalina.jar:7.0.39]
	at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
[catalina.jar:7.0.39]
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
[catalina.jar:7.0.39]
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
[catalina.jar:7.0.39]
	at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947)
[catalina.jar:7.0.39]
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
[catalina.jar:7.0.39]
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
[catalina.jar:7.0.39]
	at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
[tomcat-coyote.jar:7.0.39]
	at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
[tomcat-coyote.jar:7.0.39]
	at
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
[tomcat-coyote.jar:7.0.39]
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[na:1.7.0_21]
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[na:1.7.0_21]
	at java.lang.Thread.run(Thread.java:722) [na:1.7.0_21] Caused by:
java.util.ConcurrentModificationException: null
	at
org.apache.commons.collections.map.AbstractLinkedMap$LinkIterator.nextEntry(AbstractLinkedMap.java:560)
~[commons-collections-3.2.1.jar:3.2.1]
	at
org.apache.commons.collections.map.AbstractLinkedMap$LinkMapIterator.next(AbstractLinkedMap.java:372)
~[commons-collections-3.2.1.jar:3.2.1]
	at
org.apache.commons.collections.map.AbstractHashedMap.doWriteObject(AbstractHashedMap.java:1181)
~[commons-collections-3.2.1.jar:3.2.1]
	at org.apache.commons.collections.map.LRUMap.doWriteObject(LRUMap.java:420)
~[commons-collections-3.2.1.jar:3.2.1]
	at org.apache.commons.collections.map.LRUMap.writeObject(LRUMap.java:404)
~[commons-collections-3.2.1.jar:3.2.1]
	at sun.reflect.GeneratedMethodAccessor156.invoke(Unknown Source) ~[na:na]
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.7.0_21]
	at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_21]
	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:975)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
~[na:1.7.0_21]
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
~[na:1.7.0_21]
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
~[na:1.7.0_21]
	at
org.apache.wicket.serialize.java.JavaSerializer$SerializationCheckerObjectOutputStream.writeObjectOverride(JavaSerializer.java:260)
~[wicket-core-6.6.0.jar:6.6.0]
	... 50 common frames omitted




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-this-java-util-ConcurrentModificationException-tp4660273p4660729.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to resolve this java.util.ConcurrentModificationException

Posted by Michael Mosmann <mi...@mosmann.de>.
IMHO nothing in Application is serialized. But its far to easy to leak 
an instance of this LRU-Map into some components (anon classes).

Can you provide some code or error message?

Am 06.08.13 18:22, schrieb saty:
> I need to understand what and when Wicket tries to serialize stuff in a
> running wicket application. I am not able to fix this error and it keeps
> growing with more users starting to use the application. It does not affect
> the application usage but it keeps beaming error email.
>
> I am using LRU map to cache certain data being used in the application and
> that is a shared data in a static context not tied to any particular user.
> Why would wicket try to serialize this object, this should not be serialized
> at all. LRU map this is not synchronized and is not thread-safe and
> application code treats it that way but the serialization keeps generating
> concurrent modification exception as its obvious its trying to serialize
> this when something changes the map.
> if i declare this as transient, will this prevent wicket from serializing
> this map too, what are the possible repercussion in wicket application if i
> declare this transient.
>
> Thanks for your help.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-this-java-util-ConcurrentModificationException-tp4660273p4660725.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to resolve this java.util.ConcurrentModificationException

Posted by saty <sa...@gmail.com>.
I need to understand what and when Wicket tries to serialize stuff in a
running wicket application. I am not able to fix this error and it keeps
growing with more users starting to use the application. It does not affect
the application usage but it keeps beaming error email.

I am using LRU map to cache certain data being used in the application and
that is a shared data in a static context not tied to any particular user.
Why would wicket try to serialize this object, this should not be serialized
at all. LRU map this is not synchronized and is not thread-safe and
application code treats it that way but the serialization keeps generating
concurrent modification exception as its obvious its trying to serialize
this when something changes the map.
if i declare this as transient, will this prevent wicket from serializing
this map too, what are the possible repercussion in wicket application if i
declare this transient.

Thanks for your help.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-this-java-util-ConcurrentModificationException-tp4660273p4660725.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to resolve this java.util.ConcurrentModificationException

Posted by Francois Meillet <fr...@gmail.com>.
LRUMap is not synchronized and is not thread-safe, you must use appropriate synchronization.

see http://commons.apache.org/proper/commons-collections//javadocs/api-3.2.1/org/apache/commons/collections/map/LRUMap.html


François Meillet
Formation Wicket - Développement Wicket





Le 17 juil. 2013 à 00:35, Dan Retzlaff <dr...@gmail.com> a écrit :

> Wicket serializes access to each page instance, but provides no further
> synchronization. Non-transient references to application data must be
> synchronized by you.
> 
> 
> On Tue, Jul 16, 2013 at 2:39 PM, saty <sa...@gmail.com> wrote:
> 
>> Thanks, but could you please explain how wicket handles serialization of
>> objects that could throw this error.
>> I could be wrong but it appears to me wicket is iterating the data
>> structure
>> for its serialization efforts when its being modified by other threads as
>> well and the iteration results in ConcurrentModificationException being
>> thrown by data structure iterator.
>> 
>> 
>> 
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-this-java-util-ConcurrentModificationException-tp4660273p4660296.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
>> 


Re: How to resolve this java.util.ConcurrentModificationException

Posted by Dan Retzlaff <dr...@gmail.com>.
Wicket serializes access to each page instance, but provides no further
synchronization. Non-transient references to application data must be
synchronized by you.


On Tue, Jul 16, 2013 at 2:39 PM, saty <sa...@gmail.com> wrote:

> Thanks, but could you please explain how wicket handles serialization of
> objects that could throw this error.
> I could be wrong but it appears to me wicket is iterating the data
> structure
> for its serialization efforts when its being modified by other threads as
> well and the iteration results in ConcurrentModificationException being
> thrown by data structure iterator.
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-this-java-util-ConcurrentModificationException-tp4660273p4660296.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to resolve this java.util.ConcurrentModificationException

Posted by saty <sa...@gmail.com>.
Thanks, but could you please explain how wicket handles serialization of
objects that could throw this error. 
I could be wrong but it appears to me wicket is iterating the data structure
for its serialization efforts when its being modified by other threads as
well and the iteration results in ConcurrentModificationException being
thrown by data structure iterator.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-this-java-util-ConcurrentModificationException-tp4660273p4660296.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to resolve this java.util.ConcurrentModificationException

Posted by Sven Meier <sv...@meiers.net>.
Hi,

Wicket doesn't use commons collections - check which maps you pass into 
components or models.

Sven

On 07/15/2013 05:55 PM, saty wrote:
> Getting below error at times, looks like its coming from usage of apache
> common LRUMAa class, not sure where to start fixing this.
>
> 15 Jul 2013 11:03:42.099 [http-apr-9999-exec-3] ERROR
> o.a.w.serialize.java.JavaSerializer - error writing object [Page class =
> com.abc.xyz.web.HomePage, id = 5, render count = 6]: null
> java.util.ConcurrentModificationException: null
> 	at
> org.apache.commons.collections.map.AbstractLinkedMap$LinkIterator.nextEntry(AbstractLinkedMap.java:560)
> ~[commons-collections-3.2.1.jar:3.2.1]
> 	at
> org.apache.commons.collections.map.AbstractLinkedMap$LinkMapIterator.next(AbstractLinkedMap.java:372)
> ~[commons-collections-3.2.1.jar:3.2.1]
> 	at
> org.apache.commons.collections.map.AbstractHashedMap.doWriteObject(AbstractHashedMap.java:1181)
> ~[commons-collections-3.2.1.jar:3.2.1]
> 	at org.apache.commons.collections.map.LRUMap.doWriteObject(LRUMap.java:420)
> ~[commons-collections-3.2.1.jar:3.2.1]
> 	at org.apache.commons.collections.map.LRUMap.writeObject(LRUMap.java:404)
> ~[commons-collections-3.2.1.jar:3.2.1]
> 	at sun.reflect.GeneratedMethodAccessor130.invoke(Unknown Source) ~[na:na]
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> ~[na:1.7.0_21]
> 	at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_21]
> 	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:975)
> ~[na:1.7.0_21]
> 	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
> [na:1.7.0_21]
> 	at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
> [na:1.7.0_21]
> 	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
> [na:1.7.0_21]
> 	at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
> [na:1.7.0_21]
> 	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
> [na:1.7.0_21]
> 	at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
> [na:1.7.0_21]
>
> Thanks for your help.
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-resolve-this-java-util-ConcurrentModificationException-tp4660273.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org