Hi Daniel,

 can you please try adding -Dgwc.context.suffix=gwc to the GeoServer
JAVA_OPTS?

   Cheers,
   Emanuele

On Thu, Feb 16, 2023 at 10:57 AM Calliess Daniel Ing. <
daniel.calli...@stadt-salzburg.at> wrote:

> Hello again,
>
>
>
> I'm still struggling with the combination of GeoFence and GeoWebCache. As
> described below, after upgrading to V2.21.2 or above the paths to access
> GeoWebCache changed. Now when I'm trying to seed the tiles for a layer I'm
> getting the error 'String index out of range: -1' (see also stack trace
> below). This can easily be reproduced by:
>
>
>
>    - Install GeoServer with the default data dir (I used the Windows
>    installer for V2.22.0).
>    - Log into the web interface and then open the URL
>    http://localhost:8080/geoserver/gwc/rest/seed/topp:tasmania_cities.
>    Notice that the page loads correctly, especially the GeoServer logo image (
>    http://localhost:8080/geoserver/gwc/rest/web/geowebcache_logo.png) is
>    displayed.
>    - Add the GeoFence Server Plugin.
>    - Add the text 'gwc.context.suffix=gwc' to the file '<data
>    dir>/geofence/geofence-server.properties'.
>    - Restart GeoServer and re-login into the Admin UI.
>    - Access
>    http://localhost:8080/geoserver/gwc/rest/seed/topp:tasmania_cities =>
>    Leads to 'HTTP ERROR 404 Not Found'.
>    - Remmove 'gwc' from the URL path, i.e.
>    http://localhost:8080/geoserver/rest/seed/topp:tasmania_cities => now
>    the page loads but the logo image is missing.
>    - When trying to open the logo image
>    http://localhost:8080/geoserver/rest/web/geowebcache_logo.png
>    directly, the error message 'String index out of range: -1' is displayed
>    instead. The same error is written to the log file when submitting the seed
>    form.
>
>
>
> Before filing a bug report I wanted to check if someone else can reproduce
> the problem. Is there anybody that can confirm this behaviour?
>
>
>
> Thank you and best regards
>
> Daniel
>
>
>
> STACK TRACE OF THE ERROR:
>
> =========================
>
> 11:40:03 ERROR  [geoserver.rest] - String index out of range: -1
>
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>
>        at java.base/java.lang.String.substring(Unknown Source)
>
>        at
> org.geowebcache.rest.controller.ByteStreamController.getFileName(ByteStreamController.java:85)
>
>        at
> org.geowebcache.rest.controller.ByteStreamController.doGet(ByteStreamController.java:94)
>
>        at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>
>        at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown
> Source)
>
>        at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
>
>        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
>
>        at
> org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
>
>        at
> org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
>
>        at
> org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
>
>        at
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878)
>
>        at
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792)
>
>        at
> org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
>
>        at
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1043)
>
>        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:670)
>
>        at
> org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
>
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:779)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
>
>        at
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
>
>        at
> org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
>
>        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.LoggingFilter.doFilter(LoggingFilter.java:194)
>
>        at
> org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:70)
>
>        at
> org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:43)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
>
>        at
> org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:39)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
>
>        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.GeoServerPreAuthenticationFilter.doFilter(GeoServerPreAuthenticationFilter.java:71)
>
>        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.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
>
>        at
> org.geoserver.filters.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:77)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
>
>        at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:48)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
>
>        at
> org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:49)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
>
>        at
> org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:42)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
>
>        at
> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
>
>        at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
>
>        at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177)
>
>        at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
>
>        at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
>
>        at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
>
>        at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
>
>        at
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
>
>        at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
>
>        at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
>
>        at
> org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
>
>        at
> org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
>
>        at
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891)
>
>        at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784)
>
>        at
> org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
>
>        at
> org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
>
>        at
> org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
>
>        at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>
>        at java.base/java.lang.Thread.run(Unknown Source)
>
>
>
>
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
> http://geoserver.org/comm/userlist-guidelines.html
>
> If you want to request a feature or an improvement, also see this:
> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
>
>
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>


-- 
Regards,
Emanuele Tajariol
==
GeoServer Professional Services from the experts!
Visit http://bit.ly/gs-services-us for more information.
==

Ing. Emanuele Tajariol
Technical Lead

GeoSolutions Group
mobile: +39 347 7895230
office: +39 0584 962313
fax:      +39 0584 1660272

https://www.geosolutionsgroup.com/
http://twitter.com/geosolutions_it
-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. We remind that - as provided by
European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
e-mail or the information herein by anyone other than the intended
recipient is prohibited. If you have received this email by mistake, please
notify us immediately by telephone or e-mail.
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to