|
From: Benoit X. <bx...@ob...> - 2007-09-10 15:13:17
|
Hi *,
=20
First of all, many thanks for considering the Readony interceptor! That =
is
super to have an official implementation.
=20
I have just experienced the following problem a couple of times:
=20
java.util.ConcurrentModificationException
java.util.ConcurrentModificationException
at
java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:3=
65)
at =
java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:376)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multi=
cas
tEvent(SimpleApplicationEventMulticaster.java:74)
at
org.springframework.context.support.AbstractApplicationContext.publishEve=
nt(
AbstractApplicationContext.java:246)
at
net.xxxxx.gui.domain.BusinessEventConsumer$2.run(BusinessEventConsumer.ja=
va:
207)
at =
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread=
.ja
va:242)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.j=
ava
:163)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at sun.reflect.GeneratedMethodAccessor125.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI=
mpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
foxtrot.pumps.ConditionalEventPump.pumpEvents(ConditionalEventPump.java:9=
8)
at foxtrot.AbstractSyncWorker.post(AbstractSyncWorker.java:98)
at foxtrot.AbstractSyncWorker.post(AbstractSyncWorker.java:124)
at foxtrot.Worker.post(Worker.java:139)
at
net.xxxxxx.gui.dao.AbstractRemoteDao.executeBlockingJobInBackground(Abstr=
act
RemoteDao.java:89)
=20
My application may have more than 1 thread updating the GUI. As far as I =
can
see, there is a scenario in my app where the server triggers a refresh =
on
the GUI and the dispatching thread also tries to send an event.
=20
Is there any reason why the =
SimpleApplicationEventMulticaster.multicastEvent
is not synchronized? Should it be?
Should the synchronization be done via the
AbstractApplicationContext.publishEvent?
=20
I believe that some form of synchronization is required and that it =
should
be done on either classes and not on the caller since there may be =
many=85
=20
These 2 classes are in spring-context=85
=20
The BusinessEventConsumer line 207 is like this:
if (shouldTriggerScreenRefresh(event)) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
=20
Application.instance().getApplicationContext().publishEvent(new
ClientAppEvent(event));
}
});
}
=20
Suggestions welcomed=85
=20
Thanks
=20
Benoit.
=20
=20
=20
-------------------------------
IMPORTANT NOTICE This communication contains information that is =
considered
confidential and may also be privileged . It is for the exclusive use of =
the
intended recipient(s). If you are not the intended recipient(s) please =
note
that any form of distribution, copying or use of this communication or =
the
information in it is strictly prohibited and may be unlawful. If you =
have
received this communication in error please return it to the sender and
delete the original.
=20
No virus found in this outgoing message.
Checked by AVG Free Edition.=20
Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: =
09/09/2007
10:17
=20
|