Java.util.ConcurrentModificationException
What is causing this?
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:762)
at java.util.HashMap$KeyIterator.next(HashMap.java:798)
at serp.util.LookaheadIterator.setNext(LookaheadIterator.java:135)
at serp.util.LookaheadIterator.next(LookaheadIterator.java:60)
at
com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory.flushDeferredRe
gistrations(JDBCPersistenceManagerFactory.java:512)
at
com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory.configurePersis
tenceManager(JDBCPersistenceManagerFactory.java:669)
at
com.solarmetric.kodo.runtime.PersistenceManagerFactoryImpl.newPersistenceMan
ager(PersistenceManagerFactoryImpl.java:674)
at
com.solarmetric.kodo.runtime.PersistenceManagerFactoryImpl.getPersistenceMan
ager(PersistenceManagerFactoryImpl.java:208)
at
com.solarmetric.kodo.runtime.PersistenceManagerFactoryImpl.getPersistenceMan
ager(PersistenceManagerFactoryImpl.java:140)
I'm using 2.5.5
Kodo 2.x seems to occasionally have issues with metadata registration
and parsing. These have been resolved in 3.0. If you do not wish to
upgrade at this time, you might try specifying all your persistent
classes in the com.solarmetric.kodo.PersistentTypes configuration property.
Similar Messages
-
Iterator List Error "java.util.ConcurrentModificationException"
Hi,
I'm with a problem. I've got a set of objects in a List. I'm iterating the list and during this process, I have to add more objects to the list. The system returns the exception "java.util.ConcurrentModificationException".
What is the solution to this problem, that is, how can I iterate a list, adding or removig elements without error
Thanx
MPYou cannot add to a list while iterators are in progress. You can remove elements by calling the remove method on the iterator.
If you need to both iterate and add, consider iterating a copy of the list, like so:
List copy = new ArrayList(originalList);
for (Iterator it = copy.iterator(); it.hasNext(); ) {
// call originalList.add here
}You could also consider indexing into the list (if it's an ArrayList), and then "bumping" your indices as you add elements. -
Error: java.util.ConcurrentModificationException
Hi Experts,
I am trying to login UME from index.html, i got following error.
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
at java.util.HashMap$ValueIterator.next(HashMap.java:822)
at com.sap.tc.webdynpro.basesrvc.util.Iterators$FilteringIterator.lookAhead(Iterators.java:172)
at com.sap.tc.webdynpro.basesrvc.util.Iterators$FilteringIterator.next(Iterators.java:141)
at com.sap.tc.webdynpro.basesrvc.util.Iterators$UnmodifiableIterator.next(Iterators.java:99)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:480)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:488)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doModifyView(WindowPhaseModel.java:551)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:148)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:333)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:741)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:694)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:253)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
Pleae guide me to resolve this issue.
Thanks in Advance.
Regards,
Srinivasu.YHi Srinivasu,
Please use FQDN (fully qualified domian name) while accessing the SAP Portal URL. Also update the host file before access with server host name and IP address.
Best Regards,
Arun Jaiswal -
Java.util.ConcurrentModificationException when mapping the business rule?
Hi,
In our project there are two BP's.One is Main BP and other one is Sub BP.I would invoke the SubBP from Main BP.So Inside main Bp there is a JCD component and output of this component would be input of Sub BP.The main BP will be
Start=====>JCD===>SubBP===>End.
So when I add business rule between JCD and SubBP and Save,I am getting java.util.ConcurrentModificationException...But the mapping are seems like fine..
Please update me if any of you knows the solution.
Thanks,
Renga.S.Did not include the full stack trace, here it is:
ava.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
at java.util.AbstractList$Itr.next(Unknown Source)
at com.sun.deploy.security.WIExplorerCertStore.getCertificates(Unknown Source)
at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
at sun.plugin.security.PluginClassLoader.getPermissions(Unknown Source)
at java.security.SecureClassLoader.getProtectionDomain(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source) -
Kernel java.util.ConcurrentModificationException
Hi, I have got a few of these exceptions on one of my clustered weblogic server 9.2:
Id = BEA-000802
UserId = <WLS Kernel>
TransactionId =
ThrowableInfo = java.util.ConcurrentModificationException
at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:617)
at java.util.LinkedList$ListItr.next(LinkedList.java:552)
at weblogic.jms.common.CDSLocalProxy.peerGone(CDSLocalProxy.java:318)
at weblogic.jms.common.CDSLocalProxy.dispatcherPeerGone(CDSLocalProxy.java:307)
at weblogic.messaging.dispatcher.DispatcherWrapperState.run(DispatcherWrapperState.java:561)
at weblogic.messaging.dispatcher.DispatcherWrapperState.timerExpired(DispatcherWrapperState.java:486)
at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:265)
at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Severity = 8
ThreadName = [ACTIVE] ExecuteThread: '29' for queue: 'weblogic.kernel.Default (self-tuning)'
Message = ExecuteRequest failed
java.util.ConcurrentModificationException.
Subsystem = KernelDoes someone know if there could be something that I am doing in my application ?
thanks,
v.Kodo 2.x seems to occasionally have issues with metadata registration
and parsing. These have been resolved in 3.0. If you do not wish to
upgrade at this time, you might try specifying all your persistent
classes in the com.solarmetric.kodo.PersistentTypes configuration property. -
Java.util.ConcurrentModificationException while getObjectById
I use Kodo 3.0.2:
I want to retrieve an objkect by its primary key (primary key class) in a
stateless session bean. This is the first time I call a method on the
PersistenceManager retrieved over JNDI.
The code is:
public synchronized long getNextIdentity(String numberRange) {
IdentityMaxKey id = new IdentityMaxKey();
id.setNumberRange(numberRange);
IdentityMax im = null;
im = (IdentityMax) pm.getObjectById(id, true); <-- Exception
return im.getAndIncMaxId();
And the result is the java.util.ConcurrentModificationException on the
appServer (JBoss 3.2.3). Whats wrong?
com.cmptsis.util.exception.ConfigurationException: Remote Exception while
accessing App-Server
at
com.cmptsis.kiff.customer.delegate.ejb.CustomerDelegateImpl.createGroup(CustomerDelegateImpl.java:49)
at
com.cmptsis.kiff.client.swing.TestFrame.createTestCustomerData(TestFrame.java:43)
at com.cmptsis.kiff.client.swing.TestFrame.main(TestFrame.java:33)
Caused by: java.rmi.ServerException: RemoteException occurred in server
thread; nested exception is:
java.rmi.ServerException: RuntimeException; nested exception is:
kodo.util.FatalException: kodo.util.FatalException:
java.util.ConcurrentModificationException
NestedThrowables:
java.util.ConcurrentModificationException
NestedThrowables:
java.util.ConcurrentModificationException
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown
Source)
at
org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135)
at
org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:96)
at
org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
at
org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:100)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
at $Proxy1.createGroup(Unknown Source)
at
com.cmptsis.kiff.customer.delegate.ejb.CustomerDelegateImpl.createGroup(CustomerDelegateImpl.java:46)
... 2 more
Caused by: java.rmi.ServerException: RuntimeException; nested exception
is:
kodo.util.FatalException: kodo.util.FatalException:
java.util.ConcurrentModificationException
NestedThrowables:
java.util.ConcurrentModificationException
NestedThrowables:
java.util.ConcurrentModificationException
at
org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:361)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at
org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:700)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
Caused by: kodo.util.FatalException: kodo.util.FatalException:
java.util.ConcurrentModificationException
NestedThrowables:
java.util.ConcurrentModificationException
NestedThrowables:
java.util.ConcurrentModificationException
at kodo.util.FatalException.writeReplace(FatalException.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:896)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1011)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:299)
... 6 more
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782)
at java.util.HashMap$KeyIterator.next(HashMap.java:818)
at
kodo.meta.JDOMetaDataRepositoryImpl.processRegisteredClasses(JDOMetaDataRepositoryImpl.java:522)
at
kodo.meta.JDOMetaDataRepositoryImpl.getMetaData(JDOMetaDataRepositoryImpl.java:340)
at
kodo.meta.DelegatingJDOMetaDataRepository.getMetaData(DelegatingJDOMetaDataRepository.java:167)
at kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:248)
at
kodo.jdbc.meta.MappingRepository.getMetaData(MappingRepository.java:237)
at
kodo.runtime.PersistenceManagerImpl.newStateManager(PersistenceManagerImpl.java:1316)
at
kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1280)
at
kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1223)
at
com.cmptsis.kiff.global.server.identity.jdo.JdoIdentityDAO.getNextIdentity(JdoIdentityDAO.java:21)
at
com.cmptsis.kiff.global.server.identity.StandardDBIdentityFacade.nextIdentityByRange(StandardDBIdentityFacade.java:16)
at
com.cmptsis.kiff.customer.server.facade.CustomerFacadeLogic.createGroup(CustomerFacadeLogic.java:24)
at
com.cmptsis.kiff.customer.server.facade.ejb.CustomerSessionBean.createGroup(CustomerSessionBean.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at
org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:700)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
... 6 more
Exception in thread "main"The issue is not solved yet...
Bernd Ruecker wrote:
I use Kodo 3.0.2:
I want to retrieve an objkect by its primary key (primary key class) in a
stateless session bean. This is the first time I call a method on the
PersistenceManager retrieved over JNDI.
The code is:
public synchronized long getNextIdentity(String numberRange) {
IdentityMaxKey id = new IdentityMaxKey();
id.setNumberRange(numberRange);
IdentityMax im = null;
im = (IdentityMax) pm.getObjectById(id, true); <-- Exception
return im.getAndIncMaxId();
And the result is the java.util.ConcurrentModificationException on the
appServer (JBoss 3.2.3). Whats wrong?
com.cmptsis.util.exception.ConfigurationException: Remote Exception while
accessing App-Server
at
com.cmptsis.kiff.customer.delegate.ejb.CustomerDelegateImpl.createGroup(CustomerDelegateImpl.java:49)
at
com.cmptsis.kiff.client.swing.TestFrame.createTestCustomerData(TestFrame.java:43)
at com.cmptsis.kiff.client.swing.TestFrame.main(TestFrame.java:33)
Caused by: java.rmi.ServerException: RemoteException occurred in server
thread; nested exception is:
java.rmi.ServerException: RuntimeException; nested exception is:
kodo.util.FatalException: kodo.util.FatalException:
java.util.ConcurrentModificationException
NestedThrowables:
java.util.ConcurrentModificationException
NestedThrowables:
java.util.ConcurrentModificationException
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown
Source)
at
org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135)
at
org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:96)
at
org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
at
org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:100)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
at $Proxy1.createGroup(Unknown Source)
at
com.cmptsis.kiff.customer.delegate.ejb.CustomerDelegateImpl.createGroup(CustomerDelegateImpl.java:46)
... 2 more
Caused by: java.rmi.ServerException: RuntimeException; nested exception
is:
kodo.util.FatalException: kodo.util.FatalException:
java.util.ConcurrentModificationException
NestedThrowables:
java.util.ConcurrentModificationException
NestedThrowables:
java.util.ConcurrentModificationException
at
org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:361)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at
org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:700)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
Caused by: kodo.util.FatalException: kodo.util.FatalException:
java.util.ConcurrentModificationException
NestedThrowables:
java.util.ConcurrentModificationException
NestedThrowables:
java.util.ConcurrentModificationException
at kodo.util.FatalException.writeReplace(FatalException.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:896)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1011)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:299)
... 6 more
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782)
at java.util.HashMap$KeyIterator.next(HashMap.java:818)
at
kodo.meta.JDOMetaDataRepositoryImpl.processRegisteredClasses(JDOMetaDataRepositoryImpl.java:522)
at
kodo.meta.JDOMetaDataRepositoryImpl.getMetaData(JDOMetaDataRepositoryImpl.java:340)
at
kodo.meta.DelegatingJDOMetaDataRepository.getMetaData(DelegatingJDOMetaDataRepository.java:167)
at kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:248)
at
kodo.jdbc.meta.MappingRepository.getMetaData(MappingRepository.java:237)
at
kodo.runtime.PersistenceManagerImpl.newStateManager(PersistenceManagerImpl.java:1316)
at
kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1280)
at
kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1223)
at
com.cmptsis.kiff.global.server.identity.jdo.JdoIdentityDAO.getNextIdentity(JdoIdentityDAO.java:21)
at
com.cmptsis.kiff.global.server.identity.StandardDBIdentityFacade.nextIdentityByRange(StandardDBIdentityFacade.java:16)
at
com.cmptsis.kiff.customer.server.facade.CustomerFacadeLogic.createGroup(CustomerFacadeLogic.java:24)
at
com.cmptsis.kiff.customer.server.facade.ejb.CustomerSessionBean.createGroup(CustomerSessionBean.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at
org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:700)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
... 6 more
Exception in thread "main" -
Synchronized and java.util.ConcurrentModificationException
Hi,
I keep getting a java.util.ConcurrentModificationException when running the following code:
ArrayList tObjects = ...
synchronized (tObjects) {
Iterator tObjectsIterator = tObjects.iterator();
while (tObjectsIterator.hasNext()) {
Object tObject = tObjectsIterator.next(); -----> Exception
I run synchronized on tObjects so I can't understand why (and how) I get the Exception, can anyone help?
Thanks,
Iggythanks for the help, I still have some difficulties:
I have a (static) class ObjectsHolder which holds an ArrayList tObjects, I have various methods that access the ArrayList and return one/some elements.
I would like to synchrinize on the ArrayList tObjects in ObjectsHolder, but the holder returns the ArrayList itself I am unsure whether the access to the ArrayList will be synchronized even in the calling method.
A. -
Exception: java.util.ConcurrentModificationException
We are using BEA WebLogic 8.1 SP 3. Sometimes on application machines appear following error:
Exception: java.util.ConcurrentModificationException
<2007-01-04 16:34:20 CET> <Error> <Management> <BEA-140001> <An error occurred while getting attribute Connections on MBean
tpecaredomain:Location=portal01,Name=portal01,Type=ServerRuntime. Method: public weblogic.management.runtime.Connection[] we
blogic.t3.srvr.ServerRuntime.getConnections(). Exception: java.util.ConcurrentModificationException.
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782)
at java.util.HashMap$KeyIterator.next(HashMap.java:818)
at weblogic.rjvm.ConnectionRuntime.<init>(ConnectionRuntime.java:68)
at weblogic.rjvm.ConnectionRuntime.getConnections(ConnectionRuntime.java:26)
at weblogic.t3.srvr.ServerRuntime.getConnections(ServerRuntime.java:871)
at sun.reflect.GeneratedMethodAccessor1151.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at weblogic.management.internal.DynamicMBeanImpl.getAttribute(DynamicMBeanImpl.java:574)
at com.sun.management.jmx.MBeanServerImpl.getAttribute(MBeanServerImpl.java:1183)
at com.sun.management.jmx.MBeanServerImpl.getAttribute(MBeanServerImpl.java:1153)
at weblogic.management.internal.RemoteMBeanServerImpl.getAttribute(RemoteMBeanServerImpl.java:287)
at weblogic.management.internal.RemoteMBeanServerImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
>
When does the error appear? How we can eliminate it?I have the same problem.
Can sameone please help me?
Thanks A Lot. -
Java.util.ConcurrentModificationException when storing Hashmap with XMLenco
Hi, I'm quite sure that I don't modify the map during the storage process. The Stack-Trace contains only XMLEncoder based clases, so it doesn't helps very much.
Has anyone already encountered such a problem or has any idea how to solve it?
Thanks a lot in advance.
Greetings MichaelHi, Thanks for your reply,
but the output and debbugging shows that not modification is done during writting.
I posted the stach traces too, even I don't think it gives any hint.
Any guesses are welcome.
Greetings Michael
[DEBUG] [AWT-EventQueue-0] "2005-07-20 11:57:58,015" GUI.HauptFrame
speichern Speichern start at Line 1161
[ERROR] [AWT-EventQueue-0] "2005-07-20 11:58:13,218" GUI.HauptFrame$37
exceptionThrown at Line 1177
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782)
at java.util.HashMap$KeyIterator.next(HashMap.java:818)
at java.beans.java_util_Map_PersistenceDelegate.initialize(MetaData.java:262)
at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:191)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:393)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.DefaultPersistenceDelegate.doProperty(DefaultPersistenceDelegate.java:219)
at java.beans.DefaultPersistenceDelegate.initBean(DefaultPersistenceDelegate.java:254)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:395)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeObject1(Encoder.java:192)
at java.beans.Encoder.cloneStatement(Encoder.java:205)
at java.beans.Encoder.writeStatement(Encoder.java:236)
at java.beans.XMLEncoder.writeStatement(XMLEncoder.java:326)
at java.beans.DefaultPersistenceDelegate.invokeStatement(DefaultPersistenceDelegate.java:242)
at java.beans.java_util_List_PersistenceDelegate.initialize(MetaData.java:245)
at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:191)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:393)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.DefaultPersistenceDelegate.doProperty(DefaultPersistenceDelegate.java:219)
at java.beans.DefaultPersistenceDelegate.initBean(DefaultPersistenceDelegate.java:254)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:395)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeObject1(Encoder.java:192)
at java.beans.Encoder.cloneStatement(Encoder.java:205)
at java.beans.Encoder.writeStatement(Encoder.java:236)
at java.beans.XMLEncoder.writeStatement(XMLEncoder.java:326)
at java.beans.DefaultPersistenceDelegate.invokeStatement(DefaultPersistenceDelegate.java:242)
at java.beans.java_util_List_PersistenceDelegate.initialize(MetaData.java:245)
at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:191)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:393)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.DefaultPersistenceDelegate.doProperty(DefaultPersistenceDelegate.java:219)
at java.beans.DefaultPersistenceDelegate.initBean(DefaultPersistenceDelegate.java:254)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:395)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeObject1(Encoder.java:192)
at java.beans.Encoder.cloneStatement(Encoder.java:205)
at java.beans.Encoder.writeStatement(Encoder.java:236)
at java.beans.XMLEncoder.writeStatement(XMLEncoder.java:326)
at java.beans.DefaultPersistenceDelegate.invokeStatement(DefaultPersistenceDelegate.java:242)
at java.beans.java_util_List_PersistenceDelegate.initialize(MetaData.java:245)
at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:191)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:393)
at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:191)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:393)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.DefaultPersistenceDelegate.doProperty(DefaultPersistenceDelegate.java:219)
at java.beans.DefaultPersistenceDelegate.initBean(DefaultPersistenceDelegate.java:254)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:395)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.DefaultPersistenceDelegate.doProperty(DefaultPersistenceDelegate.java:219)
at java.beans.DefaultPersistenceDelegate.initBean(DefaultPersistenceDelegate.java:254)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:395)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.java_util_Map_PersistenceDelegate.initialize(MetaData.java:280)
at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:191)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:393)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeObject1(Encoder.java:192)
at java.beans.Encoder.cloneStatement(Encoder.java:205)
at java.beans.Encoder.writeStatement(Encoder.java:236)
at java.beans.XMLEncoder.writeStatement(XMLEncoder.java:326)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:253)
at de.zew.veranlagungssimulation.GUI.HauptFrame.speichern(HauptFrame.java:1181)
at de.zew.veranlagungssimulation.GUI.HauptFrame.speichernUnter(HauptFrame.java:1128)
at de.zew.veranlagungssimulation.GUI.HauptFrame.dateiSpeichernUnterItem_actionPerformed(HauptFrame.java:1025)
at de.zew.veranlagungssimulation.GUI.HauptFrame$8.actionPerformed(HauptFrame.java:340)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
[ERROR] [AWT-EventQueue-0] "2005-07-20 11:58:13,343" GUI.HauptFrame$37
exceptionThrown at Line 1177
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782)
at java.util.HashMap$KeyIterator.next(HashMap.java:818)
at java.beans.java_util_Map_PersistenceDelegate.initialize(MetaData.java:262)
at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:191)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:393)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.DefaultPersistenceDelegate.doProperty(DefaultPersistenceDelegate.java:219)
at java.beans.DefaultPersistenceDelegate.initBean(DefaultPersistenceDelegate.java:254)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:395)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeObject1(Encoder.java:192)
at java.beans.Encoder.cloneStatement(Encoder.java:205)
at java.beans.Encoder.writeStatement(Encoder.java:236)
at java.beans.XMLEncoder.writeStatement(XMLEncoder.java:326)
at java.beans.DefaultPersistenceDelegate.invokeStatement(DefaultPersistenceDelegate.java:242)
at java.beans.java_util_List_PersistenceDelegate.initialize(MetaData.java:245)
at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:191)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:393)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.DefaultPersistenceDelegate.doProperty(DefaultPersistenceDelegate.java:219)
at java.beans.DefaultPersistenceDelegate.initBean(DefaultPersistenceDelegate.java:254)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:395)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeObject1(Encoder.java:192)
at java.beans.Encoder.cloneStatement(Encoder.java:205)
at java.beans.Encoder.writeStatement(Encoder.java:236)
at java.beans.XMLEncoder.writeStatement(XMLEncoder.java:326)
at java.beans.DefaultPersistenceDelegate.invokeStatement(DefaultPersistenceDelegate.java:242)
at java.beans.java_util_List_PersistenceDelegate.initialize(MetaData.java:245)
at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:191)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:393)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.DefaultPersistenceDelegate.doProperty(DefaultPersistenceDelegate.java:219)
at java.beans.DefaultPersistenceDelegate.initBean(DefaultPersistenceDelegate.java:254)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:395)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeObject1(Encoder.java:192)
at java.beans.Encoder.cloneStatement(Encoder.java:205)
at java.beans.Encoder.writeStatement(Encoder.java:236)
at java.beans.XMLEncoder.writeStatement(XMLEncoder.java:326)
at java.beans.DefaultPersistenceDelegate.invokeStatement(DefaultPersistenceDelegate.java:242)
at java.beans.java_util_List_PersistenceDelegate.initialize(MetaData.java:245)
at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:191)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:393)
at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:191)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:393)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.DefaultPersistenceDelegate.doProperty(DefaultPersistenceDelegate.java:219)
at java.beans.DefaultPersistenceDelegate.initBean(DefaultPersistenceDelegate.java:254)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:395)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.DefaultPersistenceDelegate.doProperty(DefaultPersistenceDelegate.java:219)
at java.beans.DefaultPersistenceDelegate.initBean(DefaultPersistenceDelegate.java:254)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:395)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.java_util_Map_PersistenceDelegate.initialize(MetaData.java:280)
at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:191)
at java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:393)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:103)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeObject1(Encoder.java:192)
at java.beans.Encoder.cloneStatement(Encoder.java:205)
at java.beans.Encoder.writeStatement(Encoder.java:236)
at java.beans.XMLEncoder.writeStatement(XMLEncoder.java:326)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:253)
at de.zew.veranlagungssimulation.GUI.HauptFrame.speichern(HauptFrame.java:1181)
at de.zew.veranlagungssimulation.GUI.HauptFrame.speichernUnter(HauptFrame.java:1128)
at de.zew.veranlagungssimulation.GUI.HauptFrame.dateiSpeichernUnterItem_actionPerformed(HauptFrame.java:1025)
at de.zew.veranlagungssimulation.GUI.HauptFrame$8.actionPerformed(HauptFrame.java:340)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
[DEBUG] [AWT-EventQueue-0] "2005-07-20 11:58:14,015" GUI.HauptFrame
speichern Speichern ende at Line 1182 Speichern <==> Save -
Am getting "Caused by: java.util.ConcurrentModificationException"
Hi,
I written code as below
public String createHM2Req(String ReqFileNm) throws Exception
String retVal="";
String strId = "";
try
System.out.println(" --- LSReqFileNm "+ReqFileNm);
System.out.println(" -- hmReqData "+hmReqData);
strId = "TE"+getValHMProcessReq("SubjBorrId");
if(!getValHMProcessReq("SpouseId").equals("") && getValHMProcessReq("ServiceTypCd").equals("ABCD"))
strId += " TE"+getValHMProcessReq("SpouseId");
public String getValHMProcessReq(String key) throws Exception
String retVal="";
try
if(key != null && !key.equals(""))
if(!checkNull(hmReqData.get(key)+"").equals(""))
retVal = hmReqData.get(key).toString();
retVal = escape(retVal);
catch(Exception e)
e.printStackTrace();
return retVal;
In this code I decleared hmReqData as Global Hashmap
this code is working fine.
But some times am getting below exception.
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry HashMap.java:782)
at java.util.HashMap$EntryIterator.next(HashMap.java:824)
at java.util.AbstractMap.toString(AbstractMap.java:586)
at java.lang.String.valueOf(String.java:2131)
at java.lang.StringBuffer.append(StringBuffer.java:370)
can any one help me to solve this problem....
Please its urgent...
Thank U
VinodHi..
Sorry for that. But while posting the question for first time, the IE is not responded. I didnt know that it is posted...thats why i posted second time -
Am getting java.util.ConcurrentModificationException while accessing Hashma
Hi,
I written code as below
public String createHM2Req(String ReqFileNm) throws Exception
String retVal="";
String strId = "";
try
System.out.println(" --- LSReqFileNm "+ReqFileNm);
System.out.println(" -- hmReqData "+hmReqData);
strId = "TE"+getValHMProcessReq("SubjBorrId");
if(!getValHMProcessReq("SpouseId").equals("") && getValHMProcessReq("ServiceTypCd").equals("ABCD"))
strId += " TE"+getValHMProcessReq("SpouseId");
public String getValHMProcessReq(String key) throws Exception
String retVal="";
try
if(key != null && !key.equals(""))
if(!checkNull(hmReqData.get(key)+"").equals(""))
retVal = hmReqData.get(key).toString();
retVal = escape(retVal);
catch(Exception e)
e.printStackTrace();
return retVal;
Am getting below exception at run time
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782)
at java.util.HashMap$EntryIterator.next(HashMap.java:824)
at java.util.AbstractMap.toString(AbstractMap.java:586)
at java.lang.String.valueOf(String.java:2131)
at java.lang.StringBuffer.append(StringBuffer.java:370)Something is calling toString on a map and something else is modifying that map. toString will start iterating. You probably get that exception if another request at the same times modifies the map.
-
Java.util.ConcurrentModificationException when launching aa signed applet .
I am getting the following error while trying to launch a signed applet with JRE 1.6.0_01. It works fine on most of the machines.
Any help, advise is appreciated.
ThanksDid not include the full stack trace, here it is:
ava.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
at java.util.AbstractList$Itr.next(Unknown Source)
at com.sun.deploy.security.WIExplorerCertStore.getCertificates(Unknown Source)
at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
at sun.plugin.security.PluginClassLoader.getPermissions(Unknown Source)
at java.security.SecureClassLoader.getProtectionDomain(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source) -
Iterator.next() throws java.util.ConcurrentModificationException
Hello, I have a set and an iterator defined like this:
HashSet<JFrame> set = new HashSet<JFrame>();
Iterator<JFrame> iterator = set.iterator();
Then later I add frames like this:
set.add(jFrame);
Then later when I try to call:
iterator.next();
I get ConcurrentModificationException. But I only call this next() method one time and only.
I can call hasNext() method without a problem, but not next().
How do I call next() without an exception??
Markcreate an iterator and then after this you change the collection? does this sound safe?(...)after getting the iterator, don't modify the set (with exception as per api) and expect the iterator to work.
Well, I think you are making fun of me here. It's OK, I don't mind, but I want to disagree with your reasons.
"Does this sound safe?" Yes, why not? The iterator could refer to the set, whatever its contents. You could add to the set and, and then remove from it by iterator.next(), and add and remove... As long as you synchronise all these things (and I do), there is no general reason why this would be a bad thing.
But of course, the API does prohibit that explicitly, you are right. It's just that when you naturally expect certain behaviour, you don't read all of the documentation.
And then when ConcurrentModificationException happens, this exception name does not reflect what happens, as I said, I am not concurrently modifying anything in multiple threads. So the name of the exception threw me off track and I did not think it was the order of the operations that I did wrong.
Anyway, thank you very much for help. -
Hi ODI gurus,
I need your advice in resolving the ODI-20088 issue (ODI 11.1.1.6.0).,
Until i made changes(adding 2 columns) to the table in the model - everything was perfect with the execution of the Project scenarios (a driver scenario wrapping multiple scenarios/procedures from different folders within a same project).
Now after i made changes to a table in the model - by adding two columns., these two columns are reflected in the related interface, mapped those columns and also modified a related procedure. After all these, if i try to re-generate a scenario - i am encountering the ODI-20088 issue.
I did try all the listed options - but all in vain, could not resolve the issue.,
1. Tried many options with re-saving model object, related interface and procedures - the ODI-20088 issue did not get resolved.
2. Bounced DB and mid-tier services - not resolved.
3. Copied the package and tried to generate the scenario for the new copied package - not resolved
4. Created a new package without the related interface or procedure - just with variables - not resolved
5. Now, i notice - a scenario cannot be (re)generated for any of the artifacts
I am struck, cannot proceed any further, please to help in resolving the ( ODI 11g - 11.1.1.6.0) issue.
Thanks and regards,
The stack trace.,
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:977)
at java.util.HashMap$KeyIterator.next(HashMap.java:1012)
at com.sunopsis.dwg.codeinterpretor.SnpGeneratorSQLCIT.finishScenario(SnpGeneratorSQLCIT.java:2465)
at com.sunopsis.dwg.codeinterpretor.SnpGeneratorSQLCIT.mainGenTrtScenario(SnpGeneratorSQLCIT.java:11457)
at com.sunopsis.dwg.codeinterpretor.SnpGeneratorSQLCIT.mainGenTrtScenario(SnpGeneratorSQLCIT.java:11392)
at com.sunopsis.dwg.codeinterpretor.SnpGeneratorSQLCIT.mainGenScenSourceScenario(SnpGeneratorSQLCIT.java:11487)
at com.sunopsis.dwg.codeinterpretor.SnpGeneratorSQLCIT.mainGenScenSourceScenario(SnpGeneratorSQLCIT.java:11505)
at com.sunopsis.graphical.dialog.SnpsDialogScen.generateScen(SnpsDialogScen.java:190)
at com.sunopsis.graphical.scenario.DwgScenGeneratingWizard.generate(DwgScenGeneratingWizard.java:68)
at oracle.odi.ui.action.SnpsPopupActionGenerateScenHandler.actionPerformed(SnpsPopupActionGenerateScenHandler.java:103)
at oracle.odi.ui.SnpsActionControler.handleEvent(SnpsActionControler.java:89)
at oracle.ide.controller.IdeAction.performAction(IdeAction.java:529)
at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:897)
at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:502)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2319)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:358)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1224)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1264)
at java.awt.Component.processMouseEvent(Component.java:6267)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3268)
at java.awt.Component.processEvent(Component.java:6032)
at java.awt.Container.processEvent(Container.java:2042)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2101)
at java.awt.Component.dispatchEvent(Component.java:4461)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2479)
at java.awt.Component.dispatchEvent(Component.java:4461)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:175)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:162)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)Hi,
The cause of the issue is following unpublished bug:
Bug 13592619: JAVA.UTIL.CONCURRENTMODIFICATIONEXCEPTION WHEN GENERATING SCENARIO OF INTERFACE
Solution
Follow the below steps to resolve this issue :
1.First apply the Bundled Patch for ODI 11.1.1.6.3: Patch 14037855
2.After the above patch is applied, apply the ODI 11.1.1.6.3 patch: Patch 14596284
Regards,
Rickson Lewis -
Java.util.ConcurrentModification Exception
Hi
I am trying to write a caching object for my web application. I have a CacheMAnger thread which is started when Tomcat starts. I put objects onto the cache and give them a TTL. My thread occasionaly goes through and checks all the cached objects to see if they are expired. I thought this was a syncronization problem but I can't find where.
It bombs when an object expires and gets removed form the cache. The error output is below as well as a copy of the CacheManager source.
Thanks
Michael
<pre>
2003-04-15 12:55:15,161 DEBUG cache.CacheManager$1 82 - CacheManager: CustomerList in Cache... expi
ry?
EXPIRY:Tue Apr 15 17:55:04 GMT 2003CURRENT:Tue Apr 15 17:55:15 GMT 2003
2003-04-15 12:55:15,161 INFO cache.CacheManager$1 90 - CacheManager Removed CustomerList
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:750)
at java.util.HashMap$KeyIterator.next(HashMap.java:786)
at net.talisen.tsr.cache.CacheManager$1.run(CacheManager.java:77)
at java.lang.Thread.run(Thread.java:536)
</pre>
=====================================================================
<pre>
package net.talisen.tsr.cache;
import java.util.HashMap;
import java.util.Set;
import java.util.Iterator;
import org.apache.log4j.Logger;
* Title: Caching
* Description:
* Copyright: Copyright (c) 2001
* @author Michael Holly based on code from Jonathan Lurie in July 2001 Article in JavaWorld
* @version 1.0
public class CacheManager
// This is the HashMap that contains all objects in the cache.
private static java.util.HashMap cacheHashMap = new java.util.HashMap();
// This object acts as a semaphore, which protects the HashMap
// RESERVED FOR FUTURE USE private static Object lock = new Object();
static
try
//Create background thread, which will be responsible for purging expired items.
Thread threadCleanerUpper = new Thread( new Runnable()
// The default time the thread should sleep between scans. The sleep
// method takes in a millisecond value so 5000 = 5 Seconds.
final static int milliSecondSleepTime = 20000;
public void run()
Logger log = Logger.getLogger(CacheManager.class);
try
// Sets up an infinite loop.
while (true)
log.debug( "CacheManager Scanning For Expired Objects...");
// Get the set of all keys that are in cache. These are the unique
// identifiers
Set keySet = null;
Iterator keys = null;
Object key = null;
Cacheable value = null;
synchronized ( cacheHashMap )
keySet = cacheHashMap.keySet();
// An iterator is used to move through the Keyset //
synchronized( keySet )
keys = keySet.iterator();
// Sets up a loop that will iterate through each key in the KeySet
while(keys.hasNext())
// Get the individual key. We need to hold on to this key
// in case it needs to be removed
synchronized ( keys )
key = keys.next();
// Get the cacheable object associated with the key inside the cache
value = (Cacheable)cacheHashMap.get(key);
log.debug( "CacheManager: " + value.getIdentifier() + " in Cache... expiry?");
// Is the cacheable object expired?
if (value.isExpired())
//Yes it's expired! Remove it from the cache
cacheHashMap.remove(key);
cacheHashMap.notifyAll();
log.info( "CacheManager Removed " + key.toString() );
***** A LRU (least-recently used) or
LFU (least-frequently used) *****
******* would best be inserted here *****
// Puts the thread to sleep. Don't need to check it continuously
Thread.sleep( this.milliSecondSleepTime);
catch (Exception e)
e.printStackTrace();
return;
} // End run method
}); // End class definition and close new thread definition
// Sets the thread's priority to the minimum value.
threadCleanerUpper.setPriority( Thread.MIN_PRIORITY );
// Starts the thread.
threadCleanerUpper.start();
catch(Exception e)
System.out.println( "CacheManager.Static Block: " + e);
} // End static block
// default constructor
public CacheManager()
* Used to add an object to the Cache
* @param object the object to be added to the cache
public static void putCache(Cacheable object)
Logger log = Logger.getLogger(CacheManager.class);
// Remember if the HashMap previously contains a mapping for the key, the old value
// will be replaced. This is valid functioning.
if ( object == null ) {
log.debug("object to be cached is null. Caching was not attempted");
return;
if ( object.getIdentifier() == null ) {
log.debug("object to be cached has a null key. Caching was not attempted");
return;
else
synchronized ( cacheHashMap ) {
cacheHashMap.put(object.getIdentifier(), object);
log.debug( object.getIdentifier() + " cached");
* Used to get an object from the cache
* @param object the object to be retrieved from the cache
* @return the cached object
public static Cacheable getCache(Object identifier)
Logger log = Logger.getLogger(CacheManager.class);
if (identifier == null ) {
log.debug( "Cache key was null" );
return null;
log.debug("Looking for " + identifier.toString() );
//synchronized (lock) // UNCOMMENT LINE XXX
//{ // UNCOMMENT LINE XXX
Cacheable object = null;
synchronized ( cacheHashMap ) {
object = ( Cacheable )cacheHashMap.get(identifier);
// The code to create the object would be placed here.
//} // UNCOMMENT LINE XXX
if (object == null) {
log.debug( "object not found in cache");
return null;
if (object.isExpired())
log.debug( "object in cache was expired");
synchronized ( cacheHashMap ) {
cacheHashMap.remove(identifier);
return null;
else
log.debug( object.getIdentifier() + " found");
object.incrementCacheHits(); // track the performance
return object;
* Used to clear all objects from the cache
public static void emptyCache()
Logger log = Logger.getLogger(CacheManager.class);
synchronized ( cacheHashMap ) {
cacheHashMap.clear();
log.debug( "Cache cleared");
* Used to remove a particular object from the cache
* @param identifier the object to be removed from the cache
public static void removeEntry(Object identifier)
Logger log = Logger.getLogger(CacheManager.class);
if (identifier == null ) {
log.debug( "Cache key was null" );
return;
synchronized ( cacheHashMap ) {
cacheHashMap.remove(identifier);
log.debug( identifier + " removed");
* Used to get a count of cached objects
* @return number of objects in the cache
public static int getCount()
synchronized ( cacheHashMap ) {
return cacheHashMap.size();
* Used to get a set of the entries in the cache
* @param Set a set of the objects in the cache
public static Set getEntrySet()
synchronized ( cacheHashMap ) {
return cacheHashMap.entrySet();
* Used to get a html page on the status of the cache
public static String getStatus()
Set keySet = null;
Iterator keys = null;
synchronized (cacheHashMap) {
keySet = cacheHashMap.keySet();
keys = keySet.iterator();
String status = new String();
status += ( "<html><head>");
status += ( "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />");
status += ( "<meta http-equiv=\"Pragma\" content=\"no-cache\" />");
status += ( "<meta http-equiv=\"Expires\" content=\"0\" /> ");
status += ( "<meta http-equiv=\"refresh\" content=\"10\" /> ");
status += ( "</head><body>" );
status += ( "<p><h4>Cache Status " + (new java.util.Date()).toString() + "</h4>" );
status += ( "<br>Page automagically refreshed every 10 seconds<br>" );
status += ( getCount() + " object(s) cached" );
status += ( "<p>Cache contains: " );
while(keys.hasNext())
Object key = keys.next();
// Get the cacheable object associated with the key inside the cache
Cacheable object = null;
synchronized ( cacheHashMap ) {
object = (Cacheable)cacheHashMap.get(key);
status += ( "<br><b>ID:</b><i>" + object.getIdentifier() + "</i>" );
status += ( "<br> <b>Class of:</b><i>" + object.toString() + "</i>");
status += ( "<br> <b> Expires at:</b><i>" + object.getExpireDate() + "</i>");
status += ( "<br> <b> Cache Hits:</b><i>" + object.getCacheHits().toString() + "</i>");
status += ( "<br> <b> Object Size:</b><i>" + object.getByteCount(object).toString() + "</i>");
int bytesServed = object.getCacheHits().intValue() * object.getByteCount(object).intValue();
double eff = 0.0;
// handle divide by 0
if ( bytesServed > 0 ) {
eff = ( bytesServed - object.getByteCount(object).intValue() ) / bytesServed;
status += ( "<br> <b> Cache Efficiency:</b><i>" + eff + "</i><br><br>");
status += ( "</body></html>" );
return status;
* Used to get a html page on the status of the cache
public static String flushCache()
Set keySet = null;
Iterator keys = null;
synchronized ( cacheHashMap ) {
keySet = cacheHashMap.keySet();
keys = keySet.iterator();
String status = new String();
status += ( "<html><head>");
status += ( "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />");
status += ( "<meta http-equiv=\"Pragma\" content=\"no-cache\" />");
status += ( "<meta http-equiv=\"Expires\" content=\"0\" /> ");
status += ( "</head><body>" );
status += ( "<p><h4>Cache status before cache reset " + (new java.util.Date()).toString() + "</h4>" );
status += ( "<p>Cache size: " + getCount() + " object(s) cached" );
status += ( "<p>Cache contains: " );
while(keys.hasNext())
Object key = keys.next();
// Get the cacheable object associated with the key inside the cache
Cacheable object = null;
synchronized ( cacheHashMap ) {
object = (Cacheable)cacheHashMap.get(key);
status += ( "<br><b>ID:</b><i>" + object.getIdentifier() + "</i> <b>Class of:</b><i>" + object.toString() );
status += ( "</i><b> Expires at:</b>" + object.getExpireDate() + "</i>");
CacheManager.emptyCache();
status += ( "<p><h4>Cache status after cache reset " + (new java.util.Date()).toString() + "</h4>" );
status += ( "<p>Cache size: " + CacheManager.getCount() + " object(s) cached" );
status += ( "<p>Cache contains: " );
Set newKeySet = null;
Iterator newKeys = null;
synchronized ( cacheHashMap ) {
newKeySet = cacheHashMap.keySet();
newKeys = newKeySet.iterator();
// this really never gets executed
while(newKeys.hasNext())
Object key = newKeys.next();
// Get the cacheable object associated with the key inside the cache
Cacheable object = null;
synchronized ( cacheHashMap ) {
object = (Cacheable)cacheHashMap.get(key);
status += ( "<br><b>ID:</b><i>" + object.getIdentifier() + "</i> <b>Class of:</b><i>" + object.toString() );
status += ( "</i><b> Expires at:</b>" + object.getExpireDate() + "</i>");
status += ( "</body></html>" );
return status;
</pre>I think my problem is that I am iterating through all the values of the hashMap and when I find one and delete it then the iterator becomes invalid? Checkout the while loop in the thread.
I'm not sure that this scenario is consistant with the error I'm getting.
I had tried something similar to what you described... maybe I missed something. Let me try it again...
I have reposted my code below with the proper tags to render the code if you need to reference for any more suggestions.
Michael
package net.talisen.tsr.cache;
import java.util.HashMap;
import java.util.Set;
import java.util.Iterator;
import org.apache.log4j.Logger;
* Title: Caching
* Description:
* Copyright: Copyright (c) 2001
* @author Michael Holly based on code from Jonathan Lurie in July 2001 Article in JavaWorld
* @version 1.0
public class CacheManager
// This is the HashMap that contains all objects in the cache.
private static java.util.HashMap cacheHashMap = new java.util.HashMap();
// This object acts as a semaphore, which protects the HashMap
// RESERVED FOR FUTURE USE private static Object lock = new Object();
static
try
//Create background thread, which will be responsible for purging expired items.
Thread threadCleanerUpper = new Thread( new Runnable()
// The default time the thread should sleep between scans. The sleep
// method takes in a millisecond value so 5000 = 5 Seconds.
final static int milliSecondSleepTime = 20000;
public void run()
Logger log = Logger.getLogger(CacheManager.class);
try
// Sets up an infinite loop.
while (true)
log.debug( "CacheManager Scanning For Expired Objects...");
// Get the set of all keys that are in cache. These are the unique
// identifiers
Set keySet = null;
Iterator keys = null;
Object key = null;
Cacheable value = null;
synchronized ( cacheHashMap )
keySet = cacheHashMap.keySet();
// An iterator is used to move through the Keyset //
synchronized( keySet )
keys = keySet.iterator();
// Sets up a loop that will iterate through each key in the KeySet
while(keys.hasNext())
// Get the individual key. We need to hold on to this key
// in case it needs to be removed
synchronized ( keys )
key = keys.next();
// Get the cacheable object associated with the key inside the cache
value = (Cacheable)cacheHashMap.get(key);
log.debug( "CacheManager: " + value.getIdentifier() + " in Cache... expiry?");
// Is the cacheable object expired?
if (value.isExpired())
//Yes it's expired! Remove it from the cache
cacheHashMap.remove(key);
cacheHashMap.notifyAll();
log.info( "CacheManager Removed " + key.toString() );
***** A LRU (least-recently used) or
LFU (least-frequently used) *****
******* would best be inserted here *****
// Puts the thread to sleep. Don't need to check it continuously
Thread.sleep( this.milliSecondSleepTime);
catch (Exception e)
e.printStackTrace();
return;
} // End run method
}); // End class definition and close new thread definition
// Sets the thread's priority to the minimum value.
threadCleanerUpper.setPriority( Thread.MIN_PRIORITY );
// Starts the thread.
threadCleanerUpper.start();
catch(Exception e)
System.out.println( "CacheManager.Static Block: " + e);
} // End static block
// default constructor
public CacheManager()
* Used to add an object to the Cache
* @param object the object to be added to the cache
public static void putCache(Cacheable object)
Logger log = Logger.getLogger(CacheManager.class);
// Remember if the HashMap previously contains a mapping for the key, the old value
// will be replaced. This is valid functioning.
if ( object == null ) {
log.debug("object to be cached is null. Caching was not attempted");
return;
if ( object.getIdentifier() == null ) {
log.debug("object to be cached has a null key. Caching was not attempted");
return;
else
synchronized ( cacheHashMap ) {
cacheHashMap.put(object.getIdentifier(), object);
log.debug( object.getIdentifier() + " cached");
* Used to get an object from the cache
* @param object the object to be retrieved from the cache
* @return the cached object
public static Cacheable getCache(Object identifier)
Logger log = Logger.getLogger(CacheManager.class);
if (identifier == null ) {
log.debug( "Cache key was null" );
return null;
log.debug("Looking for " + identifier.toString() );
Cacheable object = null;
synchronized ( cacheHashMap ) {
object = ( Cacheable )cacheHashMap.get(identifier);
if (object == null) {
log.debug( "object not found in cache");
return null;
if (object.isExpired())
log.debug( "object in cache was expired");
synchronized ( cacheHashMap ) {
cacheHashMap.remove(identifier);
return null;
else
log.debug( object.getIdentifier() + " found");
object.incrementCacheHits(); // track the performance
return object;
* Used to clear all objects from the cache
public static void emptyCache()
Logger log = Logger.getLogger(CacheManager.class);
synchronized ( cacheHashMap ) {
cacheHashMap.clear();
log.debug( "Cache cleared");
* Used to remove a particular object from the cache
* @param identifier the object to be removed from the cache
public static void removeEntry(Object identifier)
Logger log = Logger.getLogger(CacheManager.class);
if (identifier == null ) {
log.debug( "Cache key was null" );
return;
synchronized ( cacheHashMap ) {
cacheHashMap.remove(identifier);
log.debug( identifier + " removed");
* Used to get a count of cached objects
* @return number of objects in the cache
public static int getCount()
synchronized ( cacheHashMap ) {
return cacheHashMap.size();
* Used to get a set of the entries in the cache
* @param Set a set of the objects in the cache
public static Set getEntrySet()
synchronized ( cacheHashMap ) {
return cacheHashMap.entrySet();
* Used to get a html page on the status of the cache
public static String getStatus()
Set keySet = null;
Iterator keys = null;
synchronized (cacheHashMap) {
keySet = cacheHashMap.keySet();
keys = keySet.iterator();
String status = new String();
status += ( "<html><head>");
status += ( "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />");
status += ( "<meta http-equiv=\"Pragma\" content=\"no-cache\" />");
status += ( "<meta http-equiv=\"Expires\" content=\"0\" /> ");
status += ( "<meta http-equiv=\"refresh\" content=\"10\" /> ");
status += ( "</head><body>" );
status += ( "<p><h4>Cache Status " + (new java.util.Date()).toString() + "</h4>" );
status += ( "<br>Page automagically refreshed every 10 seconds<br>" );
status += ( getCount() + " object(s) cached" );
status += ( "<p>Cache contains: " );
while(keys.hasNext())
Object key = keys.next();
// Get the cacheable object associated with the key inside the cache
Cacheable object = null;
synchronized ( cacheHashMap ) {
object = (Cacheable)cacheHashMap.get(key);
status += ( "<br><b>ID:</b><i>" + object.getIdentifier() + "</i>" );
status += ( "<br>���<b>Class�of:</b><i>" + object.toString() + "</i>");
status += ( "<br>���<b> Expires at:</b><i>" + object.getExpireDate() + "</i>");
status += ( "<br>���<b> Cache Hits:</b><i>" + object.getCacheHits().toString() + "</i>");
status += ( "<br>���<b> Object Size:</b><i>" + object.getByteCount(object).toString() + "</i>");
int bytesServed = object.getCacheHits().intValue() * object.getByteCount(object).intValue();
double eff = 0.0;
// handle divide by 0
if ( bytesServed > 0 ) {
eff = ( bytesServed - object.getByteCount(object).intValue() ) / bytesServed;
status += ( "<br>���<b> Cache Efficiency:</b><i>" + eff + "</i><br><br>");
status += ( "</body></html>" );
return status;
* Used to get a html page on the status of the cache
public static String flushCache()
Set keySet = null;
Iterator keys = null;
synchronized ( cacheHashMap ) {
keySet = cacheHashMap.keySet();
keys = keySet.iterator();
String status = new String();
status += ( "<html><head>");
status += ( "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />");
status += ( "<meta http-equiv=\"Pragma\" content=\"no-cache\" />");
status += ( "<meta http-equiv=\"Expires\" content=\"0\" /> ");
status += ( "</head><body>" );
status += ( "<p><h4>Cache status before cache reset " + (new java.util.Date()).toString() + "</h4>" );
status += ( "<p>Cache size: " + getCount() + " object(s) cached" );
status += ( "<p>Cache contains: " );
while(keys.hasNext())
Object key = keys.next();
// Get the cacheable object associated with the key inside the cache
Cacheable object = null;
synchronized ( cacheHashMap ) {
object = (Cacheable)cacheHashMap.get(key);
status += ( "<br><b>ID:</b><i>" + object.getIdentifier() + "</i> <b>Class of:</b><i>" + object.toString() );
status += ( "</i><b> Expires at:</b>" + object.getExpireDate() + "</i>");
CacheManager.emptyCache();
status += ( "<p><h4>Cache status after cache reset " + (new java.util.Date()).toString() + "</h4>" );
status += ( "<p>Cache size: " + CacheManager.getCount() + " object(s) cached" );
status += ( "<p>Cache contains: " );
Set newKeySet = null;
Iterator newKeys = null;
synchronized ( cacheHashMap ) {
newKeySet = cacheHashMap.keySet();
newKeys = newKeySet.iterator();
// this really never gets executed
while(newKeys.hasNext())
Object key = newKeys.next();
// Get the cacheable object associated with the key inside the cache
Cacheable object = null;
synchronized ( cacheHashMap ) {
object = (Cacheable)cacheHashMap.get(key);
status += ( "<br><b>ID:</b><i>" + object.getIdentifier() + "</i> <b>Class of:</b><i>" + object.toString() );
status += ( "</i><b> Expires at:</b>" + object.getExpireDate() + "</i>");
status += ( "</body></html>" );
return status;
Maybe you are looking for
-
How to capture a dv shot on an NTSC camcorder, now played thru a PAL cam?
I borrowed a dv tape shot by someone else on their camcorder and am trying to capture the content in iMovie 6 by playing it through my videocam. Specifically, the tape was shot on a new Sony dv camcorder in NTSC format, but now running thru my older
-
How to abort a running process in Oracle SQL Developer?
Is there a keystroke combination I can use? Thanks!
-
Editor won't open from Adobe Photoshop Elements 12 Organizer
After I enter my password for log in, the Editor will not open
-
Regarding File to Idoc Scenario
Dear Friends, I am performing File to Idoc Scenario in XI 3.0. Here I got struck, I am not able to see my sender file in SXMB_IFR. It is saying that no messages availabe for selection. The file was picked up successfully from the souce. Pleas
-
How to configure certificates for FTPS
Hi, ALL, I have to send FTP files to and from outside server using like (SAP XI proxy>FTP, FTP>SAP Xi proxy). I would like to use secure FTP (FTPS). How I can configure it in both sender and receiver FTP adapter? Does the certificate at XI has to b