Matthew Northcott ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=5efe618a54020e0ba83a7627
 ) *created* an issue

GeoServer ( 
https://osgeo-org.atlassian.net/browse/GEOS?atlOrigin=eyJpIjoiODJhZGU3ZWQwOGZlNGJmMThkN2VmYWU1ZmE5OGMwNWEiLCJwIjoiaiJ9
 ) / Bug ( 
https://osgeo-org.atlassian.net/browse/GEOS-10354?atlOrigin=eyJpIjoiODJhZGU3ZWQwOGZlNGJmMThkN2VmYWU1ZmE5OGMwNWEiLCJwIjoiaiJ9
 ) GEOS-10354 ( 
https://osgeo-org.atlassian.net/browse/GEOS-10354?atlOrigin=eyJpIjoiODJhZGU3ZWQwOGZlNGJmMThkN2VmYWU1ZmE5OGMwNWEiLCJwIjoiaiJ9
 ) Cascaded WMTS fails when ows:OperationsMetadata missing from capabilities ( 
https://osgeo-org.atlassian.net/browse/GEOS-10354?atlOrigin=eyJpIjoiODJhZGU3ZWQwOGZlNGJmMThkN2VmYWU1ZmE5OGMwNWEiLCJwIjoiaiJ9
 )

Issue Type: Bug Affects Versions: 2.20.1 Assignee: Unassigned Created: 
11/Jan/22 10:17 PM Environment:

Ubuntu 20.04 LTS 64-bit

Run server with jetty and geofence-server installed

mvn jetty:run -P geofence-server
Priority: Medium Reporter: Matthew Northcott ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=5efe618a54020e0ba83a7627
 )

I’m not able to properly cascade WMTS from a source that doesn’t specify the 
<ows:OperationsMetadata> section in its capabilities XML, namely 
https://basemaps.linz.govt.nz. Adding the data source and subsequent layer 
works as expected but any attempt to request tiles by, for example, layer 
preview results in the following XML being returned as a file:

<?xml version= "1.0" encoding= "UTF-8" standalone= "no" ?> <!DOCTYPE 
ServiceExceptionReport SYSTEM 
"http://localhost:8080/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"; > 
<ServiceExceptionReport version= "1.1.1" >   <ServiceException>
     java.lang.RuntimeException: Unexpected error wrapping the web map tile 
server
Unexpected error wrapping the web map tile server
serverURL
</ServiceException> </ServiceExceptionReport>

The GeoServer logs contain further detail:

12 Jan 10:14:58 ERROR [org.geoserver.ows] - 
java.lang.RuntimeException: Unexpected error wrapping the web map tile server
        at 
org.geoserver.security.decorators.DefaultSecureDataFactory.secure(DefaultSecureDataFactory.java:149)
        at 
org.geoserver.security.decorators.SecuredObjects.secure(SecuredObjects.java:70)
        at 
org.geoserver.security.decorators.SecuredWMTSStoreInfo.getWebMapTileServer(SecuredWMTSStoreInfo.java:30)
        at org.geoserver.wms.GetMap.addWMTSLayer(GetMap.java:361)
        at org.geoserver.wms.GetMap.executeInternal(GetMap.java:323)
        at org.geoserver.wms.GetMap.run(GetMap.java:203)
        at org.geoserver.wms.GetMap.run(GetMap.java:113)
        at 
org.geoserver.wms.DefaultWebMapService.getMap(DefaultWebMapService.java:250)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at 
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at 
org.geoserver.kml.WebMapServiceKmlInterceptor.invoke(WebMapServiceKmlInterceptor.java:38)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at 
org.geoserver.gwc.wms.CacheSeedingWebMapService.invoke(CacheSeedingWebMapService.java:57)
        at 
org.geoserver.gwc.wms.CacheSeedingWebMapService.invoke(CacheSeedingWebMapService.java:32)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at 
org.geoserver.gwc.wms.CachingWebMapService.invoke(CachingWebMapService.java:62)
        at 
org.geoserver.gwc.wms.CachingWebMapService.invoke(CachingWebMapService.java:41)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at 
org.geoserver.ows.util.RequestObjectLogger.invoke(RequestObjectLogger.java:51)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at 
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
        at com.sun.proxy.$Proxy120.getMap(Unknown Source)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:869)
        at 
org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:271)
        at 
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:177)
        at 
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:52)
        at 
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
        at 
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
        at 
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
        at 
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
        at 
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at 
org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1459)
        at 
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
        at 
org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1631)
        at 
org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:228)
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
        at 
org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28)
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
        at 
org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:73)
        at 
org.geoserver.ows.HTTPHeadersCollector.doFilter(HTTPHeadersCollector.java:48)
        at 
org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:70)
        at 
org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:43)
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
        at 
org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:39)
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
        at 
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)
        at 
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:71)
        at 
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
        at 
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
        at 
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:75)
        at 
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
        at 
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
        at 
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:71)
        at 
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
        at 
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:75)
        at 
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
        at 
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
        at 
org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:53)
        at 
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
        at 
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:71)
        at 
org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158)
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
        at 
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:75)
        at 
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
        at 
org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:81)
        at 
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
        at 
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:71)
        at 
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
        at 
org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:52)
        at 
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:75)
        at 
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
        at 
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
        at 
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
        at 
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
        at 
org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:142)
        at 
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358)
        at 
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271)
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
        at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:102)
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
        at 
org.geoserver.filters.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:77)
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
        at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:48)
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
        at 
org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:49)
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
        at 
org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:42)
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
        at 
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
        at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at 
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)
        at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
        at 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
        at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
        at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
        at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
        at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at 
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:191)
        at 
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
        at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.Server.handle(Server.java:516)
        at 
org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
        at 
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
        at 
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
        at 
org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
        at java.base/java.lang. Thread.run( Thread.java:829)
Caused by: java.lang.NullPointerException: serverURL
        at 
org.geotools.data.ows.AbstractOpenWebService.<init>(AbstractOpenWebService.java:109)
        at 
org.geotools.data.ows.AbstractOpenWebService.<init>(AbstractOpenWebService.java:97)
        at 
org.geotools.data.ows.AbstractOpenWebService.<init>(AbstractOpenWebService.java:88)
        at 
org.geotools.ows.wmts.WebMapTileServer.<init>(WebMapTileServer.java:157)
        at 
org.geotools.ows.wmts.WebMapTileServer.<init>(WebMapTileServer.java:145)
        at 
org.geoserver.security.decorators.SecuredWebMapTileServer.<init>(SecuredWebMapTileServer.java:35)
        at 
org.geoserver.security.decorators.DefaultSecureDataFactory.secure(DefaultSecureDataFactory.java:147)
        ... 145 more

I’ve investigated this to find that the call in 
https://github.com/geotools/geotools/blob/main/modules/extension/wmts/src/main/java/org/geotools/ows/wmts/WebMapTileServer.java#L157
 returns null as the underlying OperationType object gathers its URL data from 
the <ows:OperationsMetadata> section of the capabilities spec. There’s evidence 
of it being possible to gather this information without the OperationsMetadata 
being present, as I’ve observed QGIS 3.16 to correctly display the tiles after 
adding the WMTS server with the default configuration options.

It’s worth mentioning that in earlier testing I did, this worked as expected 
when geofence-server wasn’t installed (i.e. minimal installation). I’m not sure 
what implications this has but have included this in my environment info in 
case.

If this is something that should be supported and anyone knows how we could 
potentially approach this, feel free to share any further info.

( 
https://osgeo-org.atlassian.net/browse/GEOS-10354#add-comment?atlOrigin=eyJpIjoiODJhZGU3ZWQwOGZlNGJmMThkN2VmYWU1ZmE5OGMwNWEiLCJwIjoiaiJ9
 ) Add Comment ( 
https://osgeo-org.atlassian.net/browse/GEOS-10354#add-comment?atlOrigin=eyJpIjoiODJhZGU3ZWQwOGZlNGJmMThkN2VmYWU1ZmE5OGMwNWEiLCJwIjoiaiJ9
 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( 
https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail
 ) or iOS ( 
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8
 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100188- 
sha1:6a5f664 )
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to