1

We have a geoserver 2.7.1 running as a war on tomcat7 in a Ubuntu 14.04 box. When asking for a WMS we get a java.lang.NullPointerException, but only when the map window is above certain size and only on a specific Geoserver layer.

A request like this works fine:

http://192.168.11.50:8080/geoserver/wms?idx=117&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&tiled=false&STYLES&LAYERS=openrtls%3Atagpulse&TIME=2015-10-01T23%3A56%3A31.000Z%2F2015-10-01T23%3A56%3A31.000Z&cql_filter=(tag%3D%27354805064174992%27)&idx=117&SRS=EPSG%3A3857&WIDTH=1772&HEIGHT=1762&BBOX=240912.34468172558%2C5070200.20875346%2C241044.61657051594%2C5070331.734186896

A request like this also works fine:

http://192.168.11.50:8080/geoserver/openrtls/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&TIME=2014-07-16T16%3A00%3A00.000Z%2F2016-07-16&tiled=false&STYLES&LAYERS=openrtls%3Apresence&CQL_FILTER=floor%3D35&SRS=EPSG%3A3857&WIDTH=1527&HEIGHT=1511&BBOX=240921.48875981633%2C5070209.576768157%2C241035.47249242518%2C5070322.366172199

But this request brings back an xml with a nullPointerException:

http://192.168.11.50:8080/geoserver/openrtls/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&TIME=2014-07-16T16%3A00%3A00.000Z%2F2016-07-16&tiled=false&STYLES&LAYERS=openrtls%3Apresence&CQL_FILTER=floor%3D35&SRS=EPSG%3A3857&WIDTH=1772&HEIGHT=1762&BBOX=240952.01878380912%2C5070235.180186812%2C241018.15472820433%2C5070300.94290353

This layer is using a transformation style to produce a Heatmap. That, and the fact that only changing the size of the image requested makes it crash, would make me think about memory issues. But I have upped the max rendering memory of the WMS in Geoserver to 1048576 with the same results.

Also, if I ask for a tiled image I get no error, but the tiling of a heatmap layer does not produce good results.

Any ideas on how to fix this?

The geoserver log of the failing request says:

2015-10-15 10:09:06,299 INFO [geoserver.wms] - Request: getServiceInfo 2015-10-15 10:09:07,100 INFO [geoserver.wms] - Request: getMap Width = 1772 Height = 1762 MaxFeatures = null Crs = PROJCS["WGS 84 / Pseudo-Mercator", GEOGCS["WGS 84", DATUM["World Geodetic System 1984", SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295], AXIS["Geodetic longitude", EAST], AXIS["Geodetic latitude", NORTH], AUTHORITY["EPSG","4326"]], PROJECTION["Popular Visualisation Pseudo Mercator", AUTHORITY["EPSG","1024"]], PARAMETER["semi_minor", 6378137.0], PARAMETER["latitude_of_origin", 0.0], PARAMETER["central_meridian", 0.0], PARAMETER["scale_factor", 1.0], PARAMETER["false_easting", 0.0], PARAMETER["false_northing", 0.0], UNIT["m", 1.0], AXIS["Easting", EAST], AXIS["Northing", NORTH], AUTHORITY["EPSG","3857"]] Bbox = SRSEnvelope[240952.01878380912 : 241018.15472820433, 5070235.180186812 : 5070300.94290353] RemoteOwsType = null RemoteOwsURL = null Env = {} FormatOptions = {} Angle = 0.0 CQLFilter = [[ floor = 35 ]] Elevation = [] FeatureId = null StartIndex = null ViewParams = null Layers = [org.geoserver.wms.MapLayerInfo@be6cfff] Tiled = false Palette = null SRS = EPSG:3857 FeatureVersion = null Styles = [StyleImpl[ name=heatmap]] BgColor = java.awt.Color[r=255,g=255,b=255] Transparent = true StyleFormat = sld SldBody = null ValidateSchema = false Sld = null StyleUrl = null TilesOrigin = null Interpolations = [] Exceptions = SE_XML StyleBody = null SldVersion = null StyleVersion = null ScaleMethod = null Buffer = 0 Time = [[Wed Jul 16 18:00:00 CEST 2014, Sun Jul 17 01:59:59 CEST 2016]] Filter = [[ floor = 35 ]] Format = image/png Filters = [[ floor = 35 ]] Get = true RawKvp = {TIME=2014-07-16T16:00:00.000Z/2016-07-16, BBOX=240952.01878380912,5070235.180186812,241018.15472820433,5070300.94290353, SERVICE=WMS, TILED=false, HEIGHT=1762, REQUEST=GetMap, STYLES=, WIDTH=1772, CQL_FILTER=floor=35, TRANSPARENT=true, VERSION=1.1.1, FORMAT=image/png, LAYERS=openrtls:presence, SRS=EPSG:3857} BaseUrl = http://192.168.11.50:8080/geoserver/ RequestCharset = UTF-8 Version = 1.1.1 Request = GetMap 2015-10-15 10:09:10,507 ERROR [geoserver.ows] - java.lang.NullPointerException at com.sun.media.jai.util.SunCachedTile.(SunCachedTile.java:80) at com.sun.media.jai.util.SunTileCache.add(SunTileCache.java:257) at javax.media.jai.OpImage.addTileToCache(OpImage.java:1087) at javax.media.jai.OpImage.getTile(OpImage.java:1142) at javax.media.jai.PlanarImage.getData(PlanarImage.java:2085) at javax.media.jai.PlanarImage.getData(PlanarImage.java:2016) at javax.media.jai.RenderedOp.getData(RenderedOp.java:2266) at it.geosolutions.imageio.plugins.png.ScanlineProviderFactory.getProvider(ScanlineProviderFactory.java:53) at it.geosolutions.imageio.plugins.png.PNGWriter.isScanlineSupported(PNGWriter.java:111) at org.geoserver.wms.map.png.PNGJWriter.writePNG(PNGJWriter.java:42) at org.geoserver.wms.map.PNGMapResponse.formatImageOutputStream(PNGMapResponse.java:109) at org.geoserver.wms.map.RenderedImageMapResponse.write(RenderedImageMapResponse.java:123) at org.geoserver.ows.Dispatcher.response(Dispatcher.java:990) at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:284) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) at javax.servlet.http.HttpServlet.service(HttpServlet.java:620) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:75) at org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:71) at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71) at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:50) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73) at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73) at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:54) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69) at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73) at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92) at org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:83) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) at org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:53) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73) at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173) at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:135) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:48) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:44) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

1 Answer 1

3

I threw away three days playing with this. I decided to ask for help here and then I found the solution. Sorry for the trouble, hopefully this helps someone else.

The what: As suspected it had to do with memory issues. The machine had enough (8GB), Geoserver has a high enough limit (1GB) but Tomcat7 had a limit of 128MB. I increased it to 1GB and then it worked as expected all the time.

The how: I edited the file /etc/default/tomcat7, changed the max heap size to 1024MB and set the initial heap size to 128MB.

Original line: JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC"

New line: JAVA_OPTS="-Djava.awt.headless=true -Xms128m -Xmx1024m -XX:+UseConcMarkSweepGC"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.