Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

  1. ,
    Expert tip

    Thrown by String methods to indicate that an index is either negative or greater than the size of the string. For some methods such as the charAt method, this exception also is thrown when the index is equal to the size of the string.

  2. ,
    via oracle.com by Unknown author

    Thrown by String methods to indicate that an index is either negative or greater than the size of the string. For some methods such as the charAt method, this exception also is thrown when the index is equal to the size of the string.

Solutions on the web

via Google Groups by Remco Overdevest, 1 year ago
String index out of range: -2
via GitHub by Milzor
, 1 year ago
String index out of range: -2
via Oracle Community by 748375, 1 year ago
via Oracle Community by 843830, 1 year ago
via Google Groups by James Holobetz, 1 year ago
String index out of range: 3
java.lang.StringIndexOutOfBoundsException: String index out of range: -2	at java.lang.String.charAt(String.java:658)	at org.openehealth.ipf.commons.ihe.ws.utils.SoapUtils.extractSoapBody(SoapUtils.java:144)	at org.openehealth.ipf.commons.ihe.ws.cxf.payload.OutPayloadExtractorInterceptor.handleMessage(OutPayloadExtractorInterceptor.java:61)	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324)	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277)	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)	at com.sun.proxy.$Proxy173.documentRegistryRegistryStoredQuery(Unknown Source)	at xx.xxxxxx.xx.registry.Iti18Client.doRequest(Iti18Client.java:28)	at xx.xxxxxx.xx.mhd.MHDRequestConsumer.handleBundleProviderRequest(MHDRequestConsumer.java:139)	at org.openehealth.ipf.commons.ihe.fhir.AbstractPlainProvider.requestBundleProvider(AbstractPlainProvider.java:153)	at org.openehealth.ipf.commons.ihe.fhir.iti67.Iti67ResourceProvider.documentManifestSearch(Iti67ResourceProvider.java:105)	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	at java.lang.reflect.Method.invoke(Method.java:498)	at ca.uhn.fhir.rest.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:258)	at ca.uhn.fhir.rest.method.SearchMethodBinding.invokeServer(SearchMethodBinding.java:279)	at ca.uhn.fhir.rest.method.SearchMethodBinding.invokeServer(SearchMethodBinding.java:55)	at ca.uhn.fhir.rest.method.BaseResourceReturningMethodBinding.doInvokeServer(BaseResourceReturningMethodBinding.java:306)	at ca.uhn.fhir.rest.method.BaseResourceReturningMethodBinding.invokeServer(BaseResourceReturningMethodBinding.java:257)	at ca.uhn.fhir.rest.server.RestfulServer.handleRequest(RestfulServer.java:676)	at ca.uhn.fhir.rest.server.RestfulServer.doGet(RestfulServer.java:1226)	at ca.uhn.fhir.rest.server.RestfulServer.service(RestfulServer.java:1202)	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:108)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:89)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798)	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434)	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)	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)