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

Atlassian JIRA | Mai Nakagawa [Atlassian] | 6 months ago
  1. 0

    h3. Summary Confluence search from JIRA Issue, which uses _confluence2.search_ of _xml-rpc_, does not work with some double-byte characters. h3. Steps to Reproduce # Install Confluence 5.8.6 and JIRA 6.4.8 (latest), and applink them # On Confluence, enable Remote API # On Confluence, change indexing language to "CJK" # On Confluence, create a space and create these 2 pages: -- Title: Title-1 Body: ボディ (FYI, it is 'body' in Japanese) -- Title: Title-2 Body: ボディ (FYI, it is 'body' in Japanese) # On JIRA, create a project and a issue # On JIRA's Issue detail view, go to "More" -> "Link" -> "Confluence Page" -> "search for a page", and search Confluence pages by keyword "ボディ" # No search results, although you get the results if you use the same search keyword on Confluence (i.e. <CONF_BASE_URL>/dosearchsite.action?queryString=ボディ) See also attached "theProblem.jpg" h3. Expected Results It should show the 2 pages created in the above step h3. Actual Results No search results. The below exception is thrown in the atlassian-confluence.log file: {noformat} 2015-07-29 17:06:44,519 ERROR [http-nio-15806-exec-8] [confluence.rpc.auth.TokenAuthenticationInvocationHandler] invokeAuthenticatedMethod Error during invocation of method [search] -- url: /confluence15806/rpc/xmlrpc | userName: admin | method: search java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1955) at com.atlassian.bonnie.search.summary.Summarizer.getSummary(Summarizer.java:164) at com.atlassian.confluence.util.GeneralUtil.makeSummary(GeneralUtil.java:1733) at com.atlassian.confluence.util.GeneralUtil.makeFlatSummary(GeneralUtil.java:1769) at com.atlassian.confluence.rpc.soap.beans.RemoteSearchResult.<init>(RemoteSearchResult.java:38) at com.atlassian.confluence.rpc.soap.services.PagesSoapService.search(PagesSoapService.java:431) at com.atlassian.confluence.rpc.soap.XhtmlSoapService.search(XhtmlSoapService.java:535) at sun.reflect.GeneratedMethodAccessor848.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy1329.search(Unknown Source) at com.atlassian.confluence.rpc.xmlrpc.ConfluenceXmlRpcHandlerImpl.search(ConfluenceXmlRpcHandlerImpl.java:485) at sun.reflect.GeneratedMethodAccessor847.invoke(Unknown Source) {noformat} h3. Notes It seems that there is a problem on the implementation of _confluence2.search_ of _xml-rpc_, because JIRA uses it while Confluence search page does not. I also confirmed that the same error occurred when I sent the same search keyword using [confluence-remote-manager|https://github.com/f4nt/confluence-remote-manager/blob/master/CLI/confluence-cmd-line.py] (needs to modify the server URL at line-10 and change the search method from confluence1.search to confluence2.search at line-67). h3.Workaround No workaround is found so far

    Atlassian JIRA | 1 year ago | Mai Nakagawa [Atlassian]
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  2. 0

    h3. Summary Confluence search from JIRA Issue, which uses deprecated _confluence2.search_ of _xml-rpc_, does not work with some double-byte characters. REST API should be used instead. h3. Steps to Reproduce # Install Confluence 5.9.11 and JIRA Core 7.1.7 (latest), and applink them # On Confluence, enable Remote API # On Confluence, change indexing language to "CJK" # On Confluence, create a space and create these 2 pages: -- Title: Title-1 Body: ボディ (FYI, it is 'body' in Japanese) -- Title: Title-2 Body: ボディ (FYI, it is 'body' in Japanese) # On JIRA, create a project and a issue # On JIRA's Issue detail view, go to "More" -> "Link" -> "Confluence Page" -> "search for a page", and search Confluence pages by keyword "ボディ" # No search results, although you get the results if you use the same search keyword on Confluence (i.e. <CONF_BASE_URL>/dosearchsite.action?queryString=ボディ) See also attached "theProblem.jpg" h3. Expected Results It should show the 2 pages created in the above step h3. Actual Results No search results. The below exception is thrown in the atlassian-confluence.log file: {noformat} 2015-07-29 17:06:44,519 ERROR [http-nio-15806-exec-8] [confluence.rpc.auth.TokenAuthenticationInvocationHandler] invokeAuthenticatedMethod Error during invocation of method [search] -- url: /confluence15806/rpc/xmlrpc | userName: admin | method: search java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1955) at com.atlassian.bonnie.search.summary.Summarizer.getSummary(Summarizer.java:164) at com.atlassian.confluence.util.GeneralUtil.makeSummary(GeneralUtil.java:1733) at com.atlassian.confluence.util.GeneralUtil.makeFlatSummary(GeneralUtil.java:1769) at com.atlassian.confluence.rpc.soap.beans.RemoteSearchResult.<init>(RemoteSearchResult.java:38) at com.atlassian.confluence.rpc.soap.services.PagesSoapService.search(PagesSoapService.java:431) at com.atlassian.confluence.rpc.soap.XhtmlSoapService.search(XhtmlSoapService.java:535) at sun.reflect.GeneratedMethodAccessor848.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy1329.search(Unknown Source) at com.atlassian.confluence.rpc.xmlrpc.ConfluenceXmlRpcHandlerImpl.search(ConfluenceXmlRpcHandlerImpl.java:485) at sun.reflect.GeneratedMethodAccessor847.invoke(Unknown Source) {noformat} h3. Notes I raised it as a bug instead of suggestion, because I firstly created a bug ticket for Confluence (CONF-38631), however, it was closed because JIRA uses _xml-rpc_, which was deprecated since Confluence 5.5. h3.Workaround No workaround is found so far

    Atlassian JIRA | 6 months ago | Mai Nakagawa [Atlassian]
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  3. 0

    h3. Summary Confluence search from JIRA Issue, which uses _confluence2.search_ of _xml-rpc_, does not work with some double-byte characters. h3. Steps to Reproduce # Install Confluence 5.8.6 and JIRA 6.4.8 (latest), and applink them # On Confluence, enable Remote API # On Confluence, change indexing language to "CJK" # On Confluence, create a space and create these 2 pages: -- Title: Title-1 Body: ボディ (FYI, it is 'body' in Japanese) -- Title: Title-2 Body: ボディ (FYI, it is 'body' in Japanese) # On JIRA, create a project and a issue # On JIRA's Issue detail view, go to "More" -> "Link" -> "Confluence Page" -> "search for a page", and search Confluence pages by keyword "ボディ" # No search results, although you get the results if you use the same search keyword on Confluence (i.e. <CONF_BASE_URL>/dosearchsite.action?queryString=ボディ) See also attached "theProblem.jpg" h3. Expected Results It should show the 2 pages created in the above step h3. Actual Results No search results. The below exception is thrown in the atlassian-confluence.log file: {noformat} 2015-07-29 17:06:44,519 ERROR [http-nio-15806-exec-8] [confluence.rpc.auth.TokenAuthenticationInvocationHandler] invokeAuthenticatedMethod Error during invocation of method [search] -- url: /confluence15806/rpc/xmlrpc | userName: admin | method: search java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1955) at com.atlassian.bonnie.search.summary.Summarizer.getSummary(Summarizer.java:164) at com.atlassian.confluence.util.GeneralUtil.makeSummary(GeneralUtil.java:1733) at com.atlassian.confluence.util.GeneralUtil.makeFlatSummary(GeneralUtil.java:1769) at com.atlassian.confluence.rpc.soap.beans.RemoteSearchResult.<init>(RemoteSearchResult.java:38) at com.atlassian.confluence.rpc.soap.services.PagesSoapService.search(PagesSoapService.java:431) at com.atlassian.confluence.rpc.soap.XhtmlSoapService.search(XhtmlSoapService.java:535) at sun.reflect.GeneratedMethodAccessor848.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy1329.search(Unknown Source) at com.atlassian.confluence.rpc.xmlrpc.ConfluenceXmlRpcHandlerImpl.search(ConfluenceXmlRpcHandlerImpl.java:485) at sun.reflect.GeneratedMethodAccessor847.invoke(Unknown Source) {noformat} h3. Notes It seems that there is a problem on the implementation of _confluence2.search_ of _xml-rpc_, because JIRA uses it while Confluence search page does not. I also confirmed that the same error occurred when I sent the same search keyword using [confluence-remote-manager|https://github.com/f4nt/confluence-remote-manager/blob/master/CLI/confluence-cmd-line.py] (needs to modify the server URL at line-10 and change the search method from confluence1.search to confluence2.search at line-67). h3.Workaround No workaround is found so far

    Atlassian JIRA | 1 year ago | Mai Nakagawa [Atlassian]
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Stale data in widget when using primefaces(5.2)

    Stack Overflow | 1 year ago | Pavithra Doraiswamy
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  6. 0

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

    Stack Overflow | 1 year ago | Pavithra Doraiswamy
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1

  1. archenroot 17 times, last 1 week ago
  2. Alexandru Popa 2 times, last 3 weeks ago
  3. poroszd 3 times, last 4 weeks ago
  4. DoktorDoener666 6 times, last 1 month ago
  5. eti22 3 times, last 1 month ago
16 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:1955)
    1 frame
  3. com.atlassian.bonnie
    Summarizer.getSummary
    1. com.atlassian.bonnie.search.summary.Summarizer.getSummary(Summarizer.java:164)
    1 frame
  4. com.atlassian.confluence
    XhtmlSoapService.search
    1. com.atlassian.confluence.util.GeneralUtil.makeSummary(GeneralUtil.java:1733)
    2. com.atlassian.confluence.util.GeneralUtil.makeFlatSummary(GeneralUtil.java:1769)
    3. com.atlassian.confluence.rpc.soap.beans.RemoteSearchResult.<init>(RemoteSearchResult.java:38)
    4. com.atlassian.confluence.rpc.soap.services.PagesSoapService.search(PagesSoapService.java:431)
    5. com.atlassian.confluence.rpc.soap.XhtmlSoapService.search(XhtmlSoapService.java:535)
    5 frames
  5. Java RT
    Method.invoke
    1. sun.reflect.GeneratedMethodAccessor848.invoke(Unknown Source)
    2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    3. java.lang.reflect.Method.invoke(Method.java:497)
    3 frames
  6. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
    2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    3 frames
  7. com.atlassian.spring
    SpringProfilingInterceptor.invoke
    1. com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16)
    1 frame
  8. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    1 frame
  9. Spring Tx
    TransactionInterceptor.invoke
    1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
    1 frame
  10. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    2 frames
  11. com.sun.proxy
    $Proxy1329.search
    1. com.sun.proxy.$Proxy1329.search(Unknown Source)
    1 frame
  12. com.atlassian.confluence
    ConfluenceXmlRpcHandlerImpl.search
    1. com.atlassian.confluence.rpc.xmlrpc.ConfluenceXmlRpcHandlerImpl.search(ConfluenceXmlRpcHandlerImpl.java:485)
    1 frame
  13. Java RT
    GeneratedMethodAccessor847.invoke
    1. sun.reflect.GeneratedMethodAccessor847.invoke(Unknown Source)
    1 frame