Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-128

java.lang.IndexOutOfBoundsException during generation of User Guide pdf blocking release build.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • None
    • None

    Description

      java.lang.IndexOutOfBoundsException during generation of User Guide pdf blocking release build.

      When running mvn release:prepare the generate user guide pdf file goal fails, blocking the completion of a release build. The error we observe is below:

      [INFO] [INFO] Executed tasks
      [INFO] [INFO] [antrun:run {execution: preprocess}]
      [INFO] [INFO] Executing tasks
      [INFO] [mkdir] Created dir: /x1/asf/karaf/trunk/manual/target/manual
      [INFO] [get] Getting: https://cwiki.apache.org/confluence/display/KARA /Karaf+Users'+Guide+in+one+page
      [INFO] [get] To: /x1/asf/karaf/trunk/manual/target/manual/manual-1.99.0-SNAPSHOT.temp
      [INFO] [echo] ERROR: The following error occurred while executing this line:
      [INFO] [echo] java.lang.IndexOutOfBoundsException
      [INFO] [INFO] ------------------------------------------------------------------------
      [INFO] [ERROR] BUILD ERROR
      [INFO] [INFO] ------------------------------------------------------------------------
      [INFO] [INFO] An Ant BuildException has occured: The following error occurred while executing this line:
      [INFO] java.lang.IndexOutOfBoundsException
      [INFO]
      

      he IndexOutOfBoundsException is thrown upon executing this code fragment:

      <for list="1,2,3,4,5,6,7,8,9,10" param="letter">
          <sequential>
              <replaceregexp file="${manual}.temp" flags="g" match="&quot;/confluence/display/KARAF/([^&quot;]*)\+([^&quot;+]*)&quot;" replace="&quot;/confluence/display/KARAF/\1\2&quot;" />
          </sequential>
      </for>
      

      After reading the following discussion:
      https://issues.apache.org/bugzilla/show_bug.cgi?id=19187

      I tried the byline="true" workaround and I can now generate the Karaf manual pdf during maven release prepare.

      Essentially the issue appears to be that there exists some multi-byte character encodings in the karaf user guide on one page file. The ant task encounters an index out of bounds exception since it thinks that number of characters is equal to number of bytes mistakenly. Using byline by-passes the code block that makes this mistake.

      Attachments

        Issue Links

          Activity

            People

              jgoodyear Jamie Mark Goodyear
              jgoodyear Jamie Mark Goodyear
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: