LMS

Welcome to the Lobeo Module Server project. Please feel free to submit bugs related to it.
Tasklist

FS#369 - WebResourceServlet java.util.ConcurrentModificationException

Attached to Project: LMS
Opened by Guillaume (Guillaume) - Wednesday, 02 May 2012, 15:43 GMT
Last edited by Ferdinand (PaGaisu) - Tuesday, 29 May 2012, 08:38 GMT
Task Type Bug Report
Category
Status Closed
Assigned To Ferdinand (PaGaisu)
Operating System All
Severity Low
Priority Normal
Reported Version alpha4
Due in Version alpha5
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I stopped my LMS, replaced some jar and wars in the webtoolkit project and i got this exception

89930 [http-nio-8080-exec-9] ERROR com.lobeo.lms.http.servlet.ErrorServlet - An error [ConcurrentModificationException] occurred when handling a http request [] (WebResourceServlet,/ws/res/WebToolkit/cfg/preload)
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
at java.util.HashMap$KeyIterator.next(Unknown Source)
at com.lobeo.lms.core.service.impl.ServiceRegistry.getService(ServiceRegistry.java:211)
at com.lobeo.lms.core.ContextImpl.getService(ContextImpl.java:450)
at com.lobeo.lms.core.ContextImpl.getService(ContextImpl.java:460)
at com.lobeo.lms.http.WebResourceServlet.doGet(WebResourceServlet.java:91)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1571)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
This task depends upon

Closed by  Ferdinand (PaGaisu)
Tuesday, 29 May 2012, 08:38 GMT
Reason for closing:  Fixed
Comment by Ferdinand (PaGaisu) - Thursday, 03 May 2012, 09:20 GMT
Problem of thread safety on the ServiceRegistry.
2 threads access the registry to get a service and one of them is removing a invalid service from the registry while the other one is looking in the registry
Comment by Ferdinand (PaGaisu) - Thursday, 03 May 2012, 09:28 GMT
Solution: adding a synchronized blocked around the sensitive piece of code

Loading...