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

Upgrade past args4j 2.32

    XMLWordPrintable

Details

    • Remoting 3.32, jenkins-2.182

    Description

      Problem

      After an attempted upgrade of args4j in jenkinsci/swarm-plugin#120, the following exception was thrown:

      java.lang.IllegalStateException: Cannot set value to a final field 'hudson.remoting.jnlp.Main.urls'.
              at org.kohsuke.args4j.spi.Setters.create(Setters.java:32)
              at org.kohsuke.args4j.ClassParser.parse(ClassParser.java:34)
              at org.kohsuke.args4j.CmdLineParser.<init>(CmdLineParser.java:96)
              at org.kohsuke.args4j.CmdLineParser.<init>(CmdLineParser.java:71)
              at hudson.remoting.jnlp.Main._main(Main.java:215)
              at hudson.remoting.jnlp.Main.main(Main.java:188)
              at hudson.plugins.swarm.SwarmClient.connect(SwarmClient.java:325)
              at hudson.plugins.swarm.Client.run(Client.java:193)
              at hudson.plugins.swarm.Client.main(Client.java:130)
      

      Evaluation

      As of args4j 2.32, "final fields can no longer be set." If an args4j field is marked with the final keyword, an IllegalStateException is thrown.

      Solution

      Remove the final keyword from the fields that we expect args4j to set.

      Phase 1

      Implemented in jenkinsci/remoting#326. See the PR for testing done.

      Phase 2

      Once this change is merged and released, we can proceed with updating args4j in Jenkins core, which also involves updating the args4j dependency in Remoting. I'm explicitly postponing that work to a future PR, since at the present time Jenkins core is not using the latest version of Remoting due to a Remoting bug (see jenkinsci/jenkins#4047).

      Attachments

        Activity

          basil Basil Crow created issue -
          basil Basil Crow made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          jthompson Jeff Thompson made changes -
          Released As Remoting 3.32
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          jthompson Jeff Thompson made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          jthompson Jeff Thompson made changes -
          Comment [ Remoting side is released in 3.32. Not yet included into master. ]
          danielbeck Daniel Beck made changes -
          Released As Remoting 3.32 Remoting 3.32, jenkins-2.182
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Resolved [ 5 ]

          People

            basil Basil Crow
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: