1

I'm using Geonetwork version 2.10.3 to harvest OGC WMS service metadata but it gives me this message when i hit save button

  Unable to add a new entry
  Error : error
  Message : String index out of range: -1
  Class : StringIndexOutOfBoundsException

===================================
    SEVERE: Servlet.service() for servlet [default] in context with path [/geonetwork] threw exception
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1954)
    at org.fao.geonet.resources.Resources.locateResource(Resources.java:313)
    at org.fao.geonet.resources.Resources.loadResource(Resources.java:243)
    at org.fao.geonet.resources.ResourceFilter.doFilter(ResourceFilter.java:78)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.fao.geonet.monitor.webapp.WebappMetricsFilter.doFilter(WebappMetricsFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.fao.geonet.monitor.webapp.MetricsRegistryInitializerFilter.doFilter(MetricsRegistryInitializerFilter.java:31)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
    at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
    at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
    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.doFilterInternal(FilterChainProxy.java:178)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:155)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    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:88)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    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:503)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    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:421)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

any knows how to fix this?

  • We will need more info. What WMS service are you trying to harvest? What kind of harvester are you using? What configuration do you have on the harvester? Can you post the lines on the log around that error? – María Arias de Reyna Domínguez Nov 28 '14 at 8:27
  • The type of harvester I'm using is OGC Web Services and the type of OGC Webservice is WMS 1.1.1, my WMS is configured in GeoServer. – user30839 Nov 28 '14 at 15:04
  • Then it is a well-tested WMS server and should work. Can you copy/paste the log lines around that error? Depending on your configuration, the logfile should be named geonetwork.log or catalina.out if you are on Tomcat. – María Arias de Reyna Domínguez Dec 2 '14 at 7:58
  • Thank you for your time, This is the log text: 2014-12-02 22:30:41,677 INFO [jeeves.request] - ========================================================== 2014-12-02 22:30:41,677 INFO [jeeves.request] - HTML Request (from 0:0:0:0:0:0:0:1) : /geonetwork/srv/eng/xml.harvesting.add 2014-12-02 22:30:41,680 INFO [jeeves.service] - Dispatching : xml.harvesting.add 2014-12-02 22:30:42,096 ERROR [jeeves.service] - Exception when executing service 2014-12-02 22:30:42,096 ERROR [jeeves.service] - (C) Exc : java.lang.StringIndexOutOfBoundsException: String index out of range: -1 – user30839 Dec 2 '14 at 21:32
  • Is there a stacktrace after that line? That would be really helpful. – María Arias de Reyna Domínguez Dec 4 '14 at 9:08
1

Using help from Jose garcia, the problem is fixed.

There's a bug in 2.10.3 related to the logos, that are not loaded and causes this issue in the harvesters, as require a logo to be defined in each harvester.

The solution is to add a custom logo in the System Administration > Logo Management and use that logo for the harvester. This should fix the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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