java.lang.StringIndexOutOfBoundsException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • ODI 11g:String index out of range: -1
    via by 1054ae32-246c-4a12-bd74-efe8ee53eb44,
  • Unable to get XML output using ODI 12c
    via by Khadka,
  • Unable to create output xml file
    via by RajaSekharReddy.M,
  • When using the "Replace content between start/end tokens" if the end marker exists in multiple places on the page, the first marker is selected even if it is before the start marker. This results in failure with the following stack trace: [confluence] Performing wiki edits: Replace content between start/end tokens ERROR: Publisher com.myyearbook.hudson.plugins.confluence.ConfluencePublisher aborted due to exception java.lang.StringIndexOutOfBoundsException at java.lang.AbstractStringBuilder.delete(AbstractStringBuilder.java:702) at java.lang.StringBuffer.delete(StringBuffer.java:373) at com.myyearbook.hudson.plugins.confluence.wiki.editors.BetweenTokensEditor.performEdits(BetweenTokensEditor.java:57) at com.myyearbook.hudson.plugins.confluence.wiki.editors.MarkupEditor.performReplacement(MarkupEditor.java:57) at com.myyearbook.hudson.plugins.confluence.ConfluencePublisher.performEdits(ConfluencePublisher.java:394) at com.myyearbook.hudson.plugins.confluence.ConfluencePublisher.performWikiReplacements(ConfluencePublisher.java:353) at com.myyearbook.hudson.plugins.confluence.ConfluencePublisher.perform(ConfluencePublisher.java:327) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:685) at hudson.model.Build$RunnerImpl.post2(Build.java:162) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:632) at hudson.model.Run.run(Run.java:1459) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:239) The fix for this is trivial, just search for the next end token *after* the start token. I.e. change line 45 in BetweenTokensEditor.java from final int end = content.indexOf(endMarkerToken); to final int end = content.indexOf(endMarkerToken, start); Ideally both start and end token is unique on the page, but for example when using the DIV macro to create a page portion to replace the end token is always "</ac:rich-text-body></ac:macro>".
    via by Sampo Niskanen,
  • backspacing in the scala console kills it
    via by Unknown author,
  • When using the "Replace content between start/end tokens" if the end marker exists in multiple places on the page, the first marker is selected even if it is before the start marker. This results in failure with the following stack trace: [confluence] Performing wiki edits: Replace content between start/end tokens ERROR: Publisher com.myyearbook.hudson.plugins.confluence.ConfluencePublisher aborted due to exception java.lang.StringIndexOutOfBoundsException at java.lang.AbstractStringBuilder.delete(AbstractStringBuilder.java:702) at java.lang.StringBuffer.delete(StringBuffer.java:373) at com.myyearbook.hudson.plugins.confluence.wiki.editors.BetweenTokensEditor.performEdits(BetweenTokensEditor.java:57) at com.myyearbook.hudson.plugins.confluence.wiki.editors.MarkupEditor.performReplacement(MarkupEditor.java:57) at com.myyearbook.hudson.plugins.confluence.ConfluencePublisher.performEdits(ConfluencePublisher.java:394) at com.myyearbook.hudson.plugins.confluence.ConfluencePublisher.performWikiReplacements(ConfluencePublisher.java:353) at com.myyearbook.hudson.plugins.confluence.ConfluencePublisher.perform(ConfluencePublisher.java:327) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:685) at hudson.model.Build$RunnerImpl.post2(Build.java:162) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:632) at hudson.model.Run.run(Run.java:1459) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:239) The fix for this is trivial, just search for the next end token *after* the start token. I.e. change line 45 in BetweenTokensEditor.java from final int end = content.indexOf(endMarkerToken); to final int end = content.indexOf(endMarkerToken, start); Ideally both start and end token is unique on the page, but for example when using the DIV macro to create a page portion to replace the end token is always "</ac:rich-text-body></ac:macro>".
    via by Sampo Niskanen,
    • java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.AbstractStringBuilder.delete(AbstractStringBuilder.java:694) at java.lang.StringBuffer.delete(StringBuffer.java:369) at com.sunopsis.jdbc.driver.xml.SnpsXmlConnection.manageQuotes(SnpsXmlConnection.java:1001) at com.sunopsis.jdbc.driver.xml.SnpsXmlConnection.prepareStatement(SnpsXmlConnection.java:1241) at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at oracle.odi.core.datasource.dwgobject.support.OnConnectOnDisconnectDataSourceAdapter$OnDisconnectCommandExecutionHandler.invoke(OnConnectOnDisconnectDataSourceAdapter.java:200) at com.sun.proxy.$Proxy2.prepareStatement(Unknown Source) at oracle.odi.runtime.agent.execution.sql.SQLCommand.doInitializeStatement(SQLCommand.java:83) at oracle.odi.runtime.agent.execution.sql.SQLCommand.getStatement(SQLCommand.java:117) at oracle.odi.runtime.agent.execution.sql.SQLCommand.getBatchCommand(SQLCommand.java:337) at oracle.odi.runtime.agent.execution.sql.SQLCommand.processRecord(SQLCommand.java:137) at oracle.odi.runtime.agent.execution.cmd.TextCommand.processRecord(TextCommand.java:1) at oracle.odi.runtime.agent.execution.DataMovementTaskExecutionHandler.handleTask(DataMovementTaskExecutionHandler.java:86) at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2925) at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2637) at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:577) at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:468) at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093) at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:380) at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216) at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:312) at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:304) at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:874) at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:133) at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:84) at java.lang.Thread.run(Thread.java:745)

    Users with the same issue

    Unknown visitor1 times, last one,