NPE on cascaded WMS during GetMap (ResourcePool.getWMSLayer)

Description

A NPE occurs on GetMap requests on cascaded WMS after running GS for a certain time (sometimes hours, sometimes days).

Once the exception occured for a certain layer the exception persists and every GetMap request causes the NPE. This makes this error quite severe.

We have the same problem with totally different installations (customers).

Unfortunately there is no known way to reproduce the problem, it occurs randomly. I suspect concurrent modifications on GS internal datastructures (catalog) to be the cause.

As far as I know the capabilities of the remote WMS are cached for a certain time. Maybe on concurrent refreshes this problem occurs. But this is only a guess.

Workaround: Reload the configuration through the admin UI or disable/enable the datastore.

The same problem was already discussed here, but without result:
http://osgeo-org.1560.x6.nabble.com/Problem-with-cascadning-wms-td5259347.html

Maybe (probably?) is another symptom for the same issue.

Any hints on how to track down the problem are welcome.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 java.lang.NullPointerException at org.geoserver.catalog.ResourcePool.getWMSLayer(ResourcePool.java:1853) at org.geoserver.catalog.impl.WMSLayerInfoImpl.getWMSLayer(WMSLayerInfoImpl.java:29) at sun.reflect.GeneratedMethodAccessor327.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.geoserver.catalog.impl.ModificationProxy.invoke(ModificationProxy.java:147) at com.sun.proxy.$Proxy27.getWMSLayer(Unknown Source) at org.geoserver.wms.GetMap.executeInternal(GetMap.java:584) at org.geoserver.wms.GetMap.run(GetMap.java:279) at org.geoserver.wms.GetMap.run(GetMap.java:125) at org.geoserver.wms.DefaultWebMapService.getMap(DefaultWebMapService.java:320) at sun.reflect.GeneratedMethodAccessor264.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.geoserver.kml.WebMapServiceKmlInterceptor.invoke(WebMapServiceKmlInterceptor.java:34) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.geoserver.gwc.wms.CacheSeedingWebMapService.invoke(CacheSeedingWebMapService.java:62) at org.geoserver.gwc.wms.CacheSeedingWebMapService.invoke(CacheSeedingWebMapService.java:36) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.geoserver.gwc.wms.CachingWebMapService.invoke(CachingWebMapService.java:74) at org.geoserver.gwc.wms.CachingWebMapService.invoke(CachingWebMapService.java:55) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.geoserver.ows.util.RequestObjectLogger.invoke(RequestObjectLogger.java:33) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) at com.sun.proxy.$Proxy75.getMap(Unknown Source) at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:857) at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:268) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:147) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:859) at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:201) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:178) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:75) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:231) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71) at org.geoserver.monitor.MonitorFilter.doFilter(MonitorFilter.java:144) at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71)

This is the corresponding code:
https://github.com/geoserver/geoserver/blob/2.11.x/src/main/src/main/java/org/geoserver/catalog/ResourcePool.java#L1853

Environment

None

Status

Assignee

Unassigned

Reporter

Andreas W

Triage

None

Fix versions

None

Affects versions

2.11.1

Components

Priority

High
Configure