0 Replies Latest reply on Dec 22, 2004 10:57 AM by Tameshwar Sahu

    java.util.ConcurrentModificationException -DistributedState

    Tameshwar Sahu Newbie

      Hi all,

      I am getting the following exception one of my thread is trying to add/remove DS entry and if I click on 'java.lang.String listContent()' under DistributedMBean service of jmx-console.

      500 Servlet Exception
      RuntimeMBeanException: RuntimeException in MBean operation 'listContent()'
      Cause: java.util.ConcurrentModificationException
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:299)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:229)
      at org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:195)
      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:241)
      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:79)
      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:61)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
      at com.caucho.server.http.Invocation.service(Invocation.java:315)
      at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:246)
      at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:164)
      at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
      at java.lang.Thread.run(Thread.java:536)



      And same java.util.ConcurrentModificationException I am getting when my program calls getAllKeys and tried to interate or call addAll() method of Vertor/ArrayList ot create a local collection on same scenario.

      Collection jbossCollection = distributedState.getAllKeys("MyCategory");
      ArrayList myCollection = new ArrayList();
      myCollection.addAll(jbossCollection);


      2004-12-22 16:44:06,712 ERROR [STDERR] java.util.ConcurrentModificationException
      2004-12-22 16:44:06,713 ERROR [STDERR] at java.util.HashMap$HashIterator.nextEntry(HashMap.java:762)
      2004-12-22 16:44:06,713 ERROR [STDERR] at java.util.HashMap$KeyIterator.next(HashMap.java:798)
      2004-12-22 16:44:06,714 ERROR [STDERR] at java.util.AbstractCollection.toArray(AbstractCollection.java:121)
      2004-12-22 16:44:06,714 ERROR [STDERR] at java.util.Collections$UnmodifiableCollection.toArray(Collections.java:983)
      2004-12-22 16:44:06,714 ERROR [STDERR] at java.util.Collections$UnmodifiableCollection.toArray(Collections.java:983)
      2004-12-22 16:44:06,714 ERROR [STDERR] at com.mobilgw.sam.util.DSReaper.cleanOldDSEntires(DSReaper.java:219)
      2004-12-22 16:44:06,715 ERROR [STDERR] at com.mobilgw.sam.util.DSReaperInvoker.run(DSReaperInvoker.java:29)
      2004-12-22 16:44:06,715 ERROR [STDERR] at java.lang.Thread.run(Thread.java:536)


      Any suggestion or ideas are welcome to resolve this issue.

      Thanks,
      Monu