Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

ConcurrentModificationException in osgi.enroute.rest.simple.provider #83

Closed
eliasvasylenko opened this issue Mar 22, 2017 · 2 comments
Closed

Comments

@eliasvasylenko
Copy link
Contributor

eliasvasylenko commented Mar 22, 2017

When polling a rest service fairly frequently it sometimes fails with the following exception:

java.util.ConcurrentModificationException
	at java.util.ArrayList.sort(ArrayList.java:1456)
	at java.util.Collections.sort(Collections.java:175)
	at osgi.enroute.rest.simple.provider.RestMapper.execute(RestMapper.java:262)
	at osgi.enroute.rest.simple.provider.RestServlet.service(RestServlet.java:66)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
	at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:85)
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:79)
	at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:124)
	at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:61)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
	at org.eclipse.jetty.server.Server.handle(Server.java:518)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
	at java.lang.Thread.run(Thread.java:745)
@eliasvasylenko
Copy link
Contributor Author

Looks simple enough, I'll submit a fix shortly.

eliasvasylenko pushed a commit to eliasvasylenko/osgi.enroute.bundles that referenced this issue Mar 23, 2017
Rankings of exposed functions on the REST mapper are treated as final so
they are now sorted only when added, not for every request.

Signed-off-by: Elias N Vasylenko <[email protected]>
eliasvasylenko pushed a commit to eliasvasylenko/osgi.enroute.bundles that referenced this issue Mar 23, 2017
Rankings of exposed functions on the REST mapper are treated as final so
they can be sorted when added rather than for each request.

Signed-off-by: Elias N Vasylenko <[email protected]>
@eliasvasylenko
Copy link
Contributor Author

Done: #84.

pkriens added a commit that referenced this issue Mar 23, 2017
Fix for #83 sort functions inside existing synchronized block.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant