Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-17029

SOLR_OPTS and '-a' both break with quoted/escaped whitespace

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      It's basically impossible to use an quoted/escaped whitespace in SOLR_OPTS.

      By the time java gets the args, the quoted/escaped whitespace has been treated as a break in the argument list, and the quote characters are treated as literals characters in the argument values...

      $ SOLR_OPTS='-XX:-UseLargePages -Dfoo=bar -Dyak="white space"'  ./bin/solr start -f
      Error: Could not find or load main class space"
      Caused by: java.lang.ClassNotFoundException: space"
      
      $ SOLR_OPTS="-XX:-UseLargePages -Dfoo=bar -Dyak=white\ space"  ./bin/solr start -f
      Error: Could not find or load main class space
      Caused by: java.lang.ClassNotFoundException: space
      
      $ SOLR_OPTS='-XX:-UseLargePages -Dfoo=bar "-Dyak=white space"'  ./bin/solr start -f
      Error: Could not find or load main class "-Dyak=white
      Caused by: java.lang.ClassNotFoundException: "-Dyak=white
      

      The same problem affects the -a option...

      $ SOLR_OPTS='-XX:-UseLargePages -Dfoo=bar' ./bin/solr start -f -a '-Dyak="white space"'
      Error: Could not find or load main class space"
      Caused by: java.lang.ClassNotFoundException: space"
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hossman Chris M. Hostetter
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: