Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-16204

use system java to launch fitnesse if no JDK is configured in Jenkins

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • fitnesse-plugin
    • None

      pull request https://github.com/jenkinsci/fitnesse-plugin/pull/3 introduced a way to select the JDK used for starting a fitnesse instance: "The plugin provides a dropdown of Jenkins installed JDKs, unless only one is installed, in which case the default is used."

      The default JDK selection strategy does not work. On installations with less than two JDKs configured, after upgrading to fitnesse 1.8

      • running an existing job fails with a NPE, see attachment
      • saving a new job or updating an existing job fails with net.sf.json.JSONException: JSONObject["fitnesseJdk"] not found, see attachment

      Steps to reproduce:
      1. add Fitnesse-Plugin 1.8 to a fresh Jenkins installation
      2. create a free stye job
      3. Add an "Execute fitnesse tests" build step with the option
      "Start new Fitnesse instance as part of build".
      Fill all required fields. You can use dummy data.
      4. save configuration => net.sf.json.JSONException: JSONObject["fitnesseJdk"] not found.
      5. define a JDK in Jenkins global configuration
      6. repeat steps 3.-4. The same exception will be thrown
      7. define a second JDK in Jenkins global configuration
      8. repeat steps 3.-4. The job will be saved as expected.

          [JENKINS-16204] use system java to launch fitnesse if no JDK is configured in Jenkins

          Hossam Rabbouh added a comment - Submitted Pull Request #11 - https://github.com/jenkinsci/fitnesse-plugin/pull/11

          Code changed in jenkins
          User: hrabbouh
          Path:
          src/main/resources/hudson/plugins/fitnesse/FitnesseBuilder/config.jelly
          http://jenkins-ci.org/commit/fitnesse-plugin/d56c3dc44d37da87430f10e72447ef8d370ce03c
          Log:
          Fix for JENKINS-16204

          List JDKs even if there is only one, to ensure a value is always set.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: hrabbouh Path: src/main/resources/hudson/plugins/fitnesse/FitnesseBuilder/config.jelly http://jenkins-ci.org/commit/fitnesse-plugin/d56c3dc44d37da87430f10e72447ef8d370ce03c Log: Fix for JENKINS-16204 List JDKs even if there is only one, to ensure a value is always set.

          Code changed in jenkins
          User: lessonz
          Path:
          src/main/resources/hudson/plugins/fitnesse/FitnesseBuilder/config.jelly
          http://jenkins-ci.org/commit/fitnesse-plugin/3d0ac03abef809221e4ae0f3fbe98414c040b0c9
          Log:
          Merge pull request #11 from hrabbouh/master

          Fix for JENKINS-16204

          Compare: https://github.com/jenkinsci/fitnesse-plugin/compare/5834f5fd4b18...3d0ac03abef8

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: lessonz Path: src/main/resources/hudson/plugins/fitnesse/FitnesseBuilder/config.jelly http://jenkins-ci.org/commit/fitnesse-plugin/3d0ac03abef809221e4ae0f3fbe98414c040b0c9 Log: Merge pull request #11 from hrabbouh/master Fix for JENKINS-16204 Compare: https://github.com/jenkinsci/fitnesse-plugin/compare/5834f5fd4b18...3d0ac03abef8

          Harald Albers added a comment -

          Thanks to @lessonz for PR#11, included in Hudson Fitnesse plugin 1.9.

          This change still doesn't handle the case where no java installation is configured at all (as described in the steps to reproduce section above).
          Jenkins can handle this situation by falling back to the default java shell command.
          You can, for example, perform Maven builds under theses conditions.

          In such a case, the JDK selection is missing from the Execute fitnesse tests build step configuration. Submitting the configuration leads to a blank page with an unspecific exception being logged to the console, see fitnesse-stacktrace.txt.

          Release 1.9, however is a big improvement as it resolves the issue for the case with one installed JDK.

          So, this issue should be changed to something like "use system JDK if no JDK is configured"

          Harald Albers added a comment - Thanks to @lessonz for PR#11 , included in Hudson Fitnesse plugin 1.9. This change still doesn't handle the case where no java installation is configured at all (as described in the steps to reproduce section above). Jenkins can handle this situation by falling back to the default java shell command. You can, for example, perform Maven builds under theses conditions. In such a case, the JDK selection is missing from the Execute fitnesse tests build step configuration. Submitting the configuration leads to a blank page with an unspecific exception being logged to the console, see fitnesse-stacktrace.txt. Release 1.9, however is a big improvement as it resolves the issue for the case with one installed JDK. So, this issue should be changed to something like "use system JDK if no JDK is configured"

          All thanks should go to @hrabbouh. If he'd like to address this great, otherwise I may take a look at some point, but I'm not sure when. While I appreciate other plugins can support this situation, and I'm willing to merge a pull request with the solution, I'm not thrilled with the idea of defaulting to some "anonymous" system java.

          Ricardo Torres added a comment - All thanks should go to @hrabbouh. If he'd like to address this great, otherwise I may take a look at some point, but I'm not sure when. While I appreciate other plugins can support this situation, and I'm willing to merge a pull request with the solution, I'm not thrilled with the idea of defaulting to some "anonymous" system java.

          fixed n version 1.9 (2014-03-26)

          Antoine Aumjaud added a comment - fixed n version 1.9 (2014-03-26)

            Unassigned Unassigned
            albers Harald Albers
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: