java.lang.StringIndexOutOfBoundsException: String index out of range: -1

Spring JIRA | wu wen | 7 months ago
  1. 0

    An error occurs while binding request parameters for this path as soon as the uri contains special charaters. In my production environment, a request with a special charaters leads to an exception. Example: http://server/exp?name=wen&age=28&['] {code:java} May 17, 2016 6:20:34 PM org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[OPASpringMVC] invoke SEVERE: Servlet.service() for servlet [OPASpringMVC] in context with path [] threw exception [Request processing failed; nested exception is java.lang.StringIndexOutOfBoundsException: String index out of range: -1] with root cause java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1911) at org.springframework.beans.BeanWrapperImpl.getPropertyNameTokens(BeanWrapperImpl.java:694) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:923) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:95) at org.springframework.validation.DataBinder.applyPropertyValues(DataBinder.java:750) at org.springframework.validation.DataBinder.doBind(DataBinder.java:646) at org.springframework.web.bind.WebDataBinder.doBind(WebDataBinder.java:189) at org.springframework.web.bind.ServletRequestDataBinder.bind(ServletRequestDataBinder.java:106) at org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor.bindRequestParameters(ServletModelAttributeMethodProcessor.java:150) at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.resolveArgument(ModelAttributeMethodProcessor.java:110) at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:77) at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:162) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:129) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858) at javax.servlet.http.HttpServlet.service(HttpServlet.java:620) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) {code} https://github.com/spring-projects/spring-framework/pull/1061

    Spring JIRA | 7 months ago | wu wen
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  2. 0

    An error occurs while binding request parameters for this path as soon as the uri contains special charaters. In my production environment, a request with a special charaters leads to an exception. Example: http://server/exp?name=wen&age=28&['] {code:java} May 17, 2016 6:20:34 PM org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[OPASpringMVC] invoke SEVERE: Servlet.service() for servlet [OPASpringMVC] in context with path [] threw exception [Request processing failed; nested exception is java.lang.StringIndexOutOfBoundsException: String index out of range: -1] with root cause java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1911) at org.springframework.beans.BeanWrapperImpl.getPropertyNameTokens(BeanWrapperImpl.java:694) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:923) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:95) at org.springframework.validation.DataBinder.applyPropertyValues(DataBinder.java:750) at org.springframework.validation.DataBinder.doBind(DataBinder.java:646) at org.springframework.web.bind.WebDataBinder.doBind(WebDataBinder.java:189) at org.springframework.web.bind.ServletRequestDataBinder.bind(ServletRequestDataBinder.java:106) at org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor.bindRequestParameters(ServletModelAttributeMethodProcessor.java:150) at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.resolveArgument(ModelAttributeMethodProcessor.java:110) at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:77) at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:162) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:129) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858) at javax.servlet.http.HttpServlet.service(HttpServlet.java:620) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) {code} https://github.com/spring-projects/spring-framework/pull/1061

    Spring JIRA | 7 months ago | wu wen
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  3. 0

    How to fix the ERROR [[jsp]] Servlet.service() for servlet jsp threw exception?

    Stack Overflow | 2 years ago | balaguru
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Error On Startup

    GitHub | 4 years ago | N1T3SLAY3R
    org.bukkit.event.EventException

  1. richard77 2 times, last 2 days ago
  2. kjhdofjosvs 2 times, last 6 days ago
  3. archenroot 17 times, last 2 weeks ago
  4. Alexandru Popa 2 times, last 3 weeks ago
  5. poroszd 3 times, last 1 month ago
18 more registered users
58 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.StringIndexOutOfBoundsException

    String index out of range: -1

    at java.lang.String.substring()
  2. Java RT
    String.substring
    1. java.lang.String.substring(String.java:1911)
    1 frame
  3. Spring Beans
    AbstractPropertyAccessor.setPropertyValues
    1. org.springframework.beans.BeanWrapperImpl.getPropertyNameTokens(BeanWrapperImpl.java:694)
    2. org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:923)
    3. org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:95)
    3 frames
  4. Spring Context
    DataBinder.doBind
    1. org.springframework.validation.DataBinder.applyPropertyValues(DataBinder.java:750)
    2. org.springframework.validation.DataBinder.doBind(DataBinder.java:646)
    2 frames
  5. Spring
    ServletRequestDataBinder.bind
    1. org.springframework.web.bind.WebDataBinder.doBind(WebDataBinder.java:189)
    2. org.springframework.web.bind.ServletRequestDataBinder.bind(ServletRequestDataBinder.java:106)
    2 frames
  6. Spring MVC
    ServletModelAttributeMethodProcessor.bindRequestParameters
    1. org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor.bindRequestParameters(ServletModelAttributeMethodProcessor.java:150)
    1 frame
  7. Spring
    InvocableHandlerMethod.invokeForRequest
    1. org.springframework.web.method.annotation.ModelAttributeMethodProcessor.resolveArgument(ModelAttributeMethodProcessor.java:110)
    2. org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:77)
    3. org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:162)
    4. org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:129)
    4 frames
  8. Spring MVC
    FrameworkServlet.doGet
    1. org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
    2. org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
    3. org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
    4. org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    5. org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
    6. org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    7. org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
    8. org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858)
    8 frames
  9. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
    1 frame
  10. Spring MVC
    FrameworkServlet.service
    1. org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
    1 frame
  11. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    1 frame