WMTS сервис geoserver 'a недоступен после разрешения CORS

Mapserver, GeoServer, MapGuide, Google и другое ПО для веб-картографии
Ответить
Аватара пользователя
Crackfox
Активный участник
Сообщения: 128
Зарегистрирован: 02 мар 2016, 20:29
Репутация: 16
Ваше звание: разрядник
Откуда: Москва
Контактная информация:

WMTS сервис geoserver 'a недоступен после разрешения CORS

Сообщение Crackfox » 02 сен 2019, 12:22

Добрый день.
Который день бодаемся с загадочной проблемой, усугубленной еще тем что прямого доступа к серверу где развернут geoserver у меня нет)
Суть проблемы: после изменения (в целях разрешить CORS) файла web.xml служба wmts перестала работать.

в web.xml по советам из интернетов были добавлены следующие заголовки:
The minimal configuration required to use this filter is:

Код: Выделить всё

<filter>
  <filter-name>CorsFilter</filter-name>
  <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
</filter>
<filter-mapping>
  <filter-name>CorsFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>
далее перезагружен tomcat.

В gui geoserver' a по пути службы wmts страница заявляет

Код: Выделить всё

400: null
а попытавшись зайти в gui в раздел кешированные слои, лог сыпет:

Код: Выделить всё

org.apache.wicket.WicketRuntimeException: Error attaching this container for rendering: [OddEvenItem [Component id = 9]]
	at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1848)
	at org.apache.wicket.Component.onBeforeRender(Component.java:3916)
	at org.apache.wicket.Component.internalBeforeRender(Component.java:950)
	at org.apache.wicket.Component.beforeRender(Component.java:1018)
	at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1836)
	at org.apache.wicket.Component.onBeforeRender(Component.java:3916)
	at org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:143)
	at org.apache.wicket.markup.repeater.AbstractPageableView.onBeforeRender(AbstractPageableView.java:115)
	at org.apache.wicket.Component.internalBeforeRender(Component.java:950)
	at org.apache.wicket.Component.beforeRender(Component.java:1018)
	at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1836)
	at org.apache.wicket.Component.onBeforeRender(Component.java:3916)
	at org.apache.wicket.Component.internalBeforeRender(Component.java:950)
	at org.apache.wicket.Component.beforeRender(Component.java:1018)
	at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1836)
	at org.apache.wicket.Component.onBeforeRender(Component.java:3916)
	at org.apache.wicket.Component.internalBeforeRender(Component.java:950)
	at org.apache.wicket.Component.beforeRender(Component.java:1018)
	at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1836)
	at org.apache.wicket.Component.onBeforeRender(Component.java:3916)
	at org.apache.wicket.Page.onBeforeRender(Page.java:801)
	at org.apache.wicket.Component.internalBeforeRender(Component.java:950)
	at org.apache.wicket.Component.beforeRender(Component.java:1018)
	at org.apache.wicket.Component.internalPrepareForRender(Component.java:2236)
	at org.apache.wicket.Page.internalPrepareForRender(Page.java:242)
	at org.apache.wicket.Component.render(Component.java:2325)
	at org.apache.wicket.Page.renderPage(Page.java:1018)
	at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:124)
	at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:236)
	at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
	at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:895)
	at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
	at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265)
	at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222)
	at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293)
	at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261)
	at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:203)
	at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:137)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:165)
	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:1038)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:998)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:890)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:875)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:26)
	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:69)
	at org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:73)
	at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:66)
	at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:41)
	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:37)
	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:320)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
	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:74)
	at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:74)
	at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
	at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:51)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:74)
	at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
	at org.geoserver.security.filter.GeoServerUserNamePasswordAuthenticationFilter.doFilter(GeoServerUserNamePasswordAuthenticationFilter.java:122)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
	at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:158)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:74)
	at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
	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:74)
	at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
	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:357)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
	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:90)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.geoserver.filters.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:79)
	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:46)
	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:42)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	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:218)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at org.geoserver.gwc.layer.StyleParameterFilter.setLayer(StyleParameterFilter.java:188)
	at org.geoserver.gwc.layer.TileLayerInfoUtil.checkAutomaticStyles(TileLayerInfoUtil.java:162)
	at org.geoserver.gwc.layer.TileLayerInfoUtil.checkAutomaticStyles(TileLayerInfoUtil.java:140)
	at org.geoserver.gwc.layer.GeoServerTileLayer.getPublishedInfo(GeoServerTileLayer.java:374)
	at org.geoserver.gwc.layer.GeoServerTileLayer.getLayerInfo(GeoServerTileLayer.java:355)
	at org.geoserver.gwc.web.GWCIconFactory.getSpecificLayerIcon(GWCIconFactory.java:54)
	at org.geoserver.gwc.web.layer.CachedLayerProvider$1.getPropertyValue(CachedLayerProvider.java:43)
	at org.geoserver.gwc.web.layer.CachedLayerProvider$1.getPropertyValue(CachedLayerProvider.java:37)
	at org.geoserver.gwc.web.layer.CachedLayersPage$1.getComponentForProperty(CachedLayersPage.java:86)
	at org.geoserver.web.wicket.GeoServerTablePanel$5.populateItem(GeoServerTablePanel.java:238)
	at org.apache.wicket.markup.html.list.ListView.onPopulate(ListView.java:523)
	at org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:124)
	at org.apache.wicket.Component.internalBeforeRender(Component.java:950)
	at org.apache.wicket.Component.beforeRender(Component.java:1018)
	at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1836)
Пока будем временно решать пробелму с помощью MapProxy. но проблему хотелось бы решить.

Аватара пользователя
Филиппов Владислав
Гуру
Сообщения: 1016
Зарегистрирован: 17 фев 2006, 06:28
Проекты: 1
Репутация: 138
Ваше звание: Геннадич
Откуда: Новосибирск
Контактная информация:

Re: WMTS сервис geoserver 'a недоступен после разрешения CORS

Сообщение Филиппов Владислав » 10 сен 2019, 06:16

если вы удалите добавленные строки из web.xml, то всё работает как надо?

Аватара пользователя
Crackfox
Активный участник
Сообщения: 128
Зарегистрирован: 02 мар 2016, 20:29
Репутация: 16
Ваше звание: разрядник
Откуда: Москва
Контактная информация:

Re: WMTS сервис geoserver 'a недоступен после разрешения CORS

Сообщение Crackfox » 10 сен 2019, 12:23

Филиппов Владислав писал(а):
10 сен 2019, 06:16
если вы удалите добавленные строки из web.xml, то всё работает как надо?
мы их закоментили, что по идее равно тому что их нет...
проблема с wmts осталась.

Ответить

Вернуться в «Веб-картография»

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и 1 гость