georchestra / mapstore2-georchestra

geOrchestra newest viewer
Other
6 stars 23 forks source link

EHCache filter fails on UI resources #84

Open pmauduit opened 4 years ago

pmauduit commented 4 years ago

Encountered on a tomcat image (using the dockerfile provided in the repository):

WARN   2019-11-15 14:31:12.510   Filter.logThrowable() - Throwable thrown during doFilter on request with URI: /GeOrchestra/dist/GeOrchestra.js and Query: nullFailure when attempting to set Content-Encoding: gzip 
net.sf.ehcache.constructs.web.ResponseHeadersNotModifiableException: Failure when attempting to set Content-Encoding: gzip
    at net.sf.ehcache.constructs.web.ResponseUtil.addGzipHeader(ResponseUtil.java:126)
    at net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:89)
    at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:89)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

Encountering a similar issue trying the generated webapp in a Jetty container:

mapstore2_1  | 2019-11-15 14:43:14.511:WARN:oejs.HttpChannel:qtp1709537756-31: /GeOrchestra/MapStore2/web/client/libs/cesium-navigation/cesium-navigation.css
mapstore2_1  | javax.servlet.ServletException: javax.servlet.ServletException: java.lang.IllegalStateException: WRITER
mapstore2_1  |  at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:168)
mapstore2_1  |  at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:174)
mapstore2_1  |  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
mapstore2_1  |  at org.eclipse.jetty.server.Server.handle(Server.java:505)
mapstore2_1  |  at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
mapstore2_1  |  at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
mapstore2_1  |  at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
mapstore2_1  |  at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
mapstore2_1  |  at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
mapstore2_1  |  at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
mapstore2_1  |  at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
mapstore2_1  |  at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
mapstore2_1  |  at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
mapstore2_1  |  at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
mapstore2_1  |  at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698)
mapstore2_1  |  at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804)
mapstore2_1  |  at java.lang.Thread.run(Thread.java:748)
mapstore2_1  | Caused by: 
mapstore2_1  | javax.servlet.ServletException: java.lang.IllegalStateException: WRITER
mapstore2_1  |  at net.sf.ehcache.constructs.web.filter.Filter.logThrowable(Filter.java:147)
mapstore2_1  |  at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:102)
mapstore2_1  |  at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1602)
mapstore2_1  |  at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
mapstore2_1  |  at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
mapstore2_1  |  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
mapstore2_1  |  at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
mapstore2_1  |  at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
mapstore2_1  |  at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)
mapstore2_1  |  at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:152)
mapstore2_1  |  at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:174)
mapstore2_1  |  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
mapstore2_1  |  at org.eclipse.jetty.server.Server.handle(Server.java:505)
mapstore2_1  |  at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
mapstore2_1  |  at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
mapstore2_1  |  at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
mapstore2_1  |  at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
mapstore2_1  |  at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
mapstore2_1  |  at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
mapstore2_1  |  at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
mapstore2_1  |  at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
mapstore2_1  |  at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
mapstore2_1  |  at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
mapstore2_1  |  at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698)
mapstore2_1  |  at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804)
mapstore2_1  |  at java.lang.Thread.run(Thread.java:748)
mapstore2_1  | Caused by: 
mapstore2_1  | java.lang.IllegalStateException: WRITER
mapstore2_1  |  at org.eclipse.jetty.server.Response.getOutputStream(Response.java:1019)
mapstore2_1  |  at net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:93)
mapstore2_1  |  at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:89)
mapstore2_1  |  at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1602)
mapstore2_1  |  at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
mapstore2_1  |  at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
mapstore2_1  |  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
mapstore2_1  |  at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
mapstore2_1  |  at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
mapstore2_1  |  at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
mapstore2_1  |  at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)
mapstore2_1  |  at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:152)
mapstore2_1  |  at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:174)
mapstore2_1  |  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
mapstore2_1  |  at org.eclipse.jetty.server.Server.handle(Server.java:505)
mapstore2_1  |  at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
mapstore2_1  |  at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
mapstore2_1  |  at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
mapstore2_1  |  at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
mapstore2_1  |  at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
mapstore2_1  |  at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
mapstore2_1  |  at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
mapstore2_1  |  at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
mapstore2_1  |  at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
mapstore2_1  |  at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
mapstore2_1  |  at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698)
mapstore2_1  |  at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804)
mapstore2_1  |  at java.lang.Thread.run(Thread.java:748)
pmauduit commented 4 years ago

It actually fails only if the webapp is generated without having generated the web resources before (npm).

pmauduit commented 4 years ago

But even if this is ok with the web ones, I still encounter the same issue with some other resources:

mapstore2_1  | 2019-11-15 17:35:22.479:WARN:oejs.HttpChannel:qtp1709537756-21: /GeOrchestra/pdf.worker.js
mapstore2_1  | javax.servlet.ServletException: javax.servlet.ServletException: java.lang.IllegalStateException: WRITER
[...]
mapstore2_1  | Caused by: 
mapstore2_1  | java.lang.IllegalStateException: WRITER
mapstore2_1  |  at org.eclipse.jetty.server.Response.getOutputStream(Response.java:1019)
mapstore2_1  |  at net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:93)
mapstore2_1  |  at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:89)
mbarto commented 4 years ago

Hi @pmauduit I think the errors you get are related to missing static resources (js, css). The filter is probably called after the web container already sent an error response (404), so it cannot be applied. I will check why/when it's looking for pdf.worker.js and why it is missing.

mbarto commented 4 years ago

Look here: https://github.com/geosolutions-it/MapStore2/issues/4511

mbarto commented 4 years ago

We did an investigation, and the missing file is not mandatory, the printing functionality works also without it. We still want to check if having the js file in the deploy is useful for performance or anything else.