Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plug-in still depends on deprecated (and removed) Apache Commons HttpClient #356

Open
kwisatz opened this issue Dec 11, 2022 · 2 comments
Open

Comments

@kwisatz
Copy link

kwisatz commented Dec 11, 2022

The Apache Commons HttpClient has been deprecated for a while and removed from Jenkins. See e.g. this ticket for a similar issue with another plug-in.

See also: #337

Due to this, notifications back to Phabricator/Phorge now fail with the following Exception:

java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
	at jenkins.util.URLClassLoader2.findClass(URLClassLoader2.java:35)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
Caused: java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod
	at com.uber.jenkins.phabricator.PhabricatorNotifier.getUberallsClient(PhabricatorNotifier.java:303)
	at com.uber.jenkins.phabricator.PhabricatorNotifier.perform(PhabricatorNotifier.java:136)
	at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:101)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:71)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

E.g. in such a step:

post {
        always {
          script {
                step([$class: 'PhabricatorNotifier', commentOnSuccess: false, commentWithConsoleLinkOnFailure: true])
          }
        }
}

A plug-in exists for version 3.x of httpclient, but not for the version 4.x used by this plug-in.

Additional resources that may be of interest:

@dereckson
Copy link

dereckson commented Jan 5, 2023

According jenkinsci/jenkins#7312, two upgrade paths are offered to plugin maintainers:

  • migrate code to the native Java 11 HTTP client
  • update dependencies to depend on the legacy Commons HttpClient 3.x API plugin

The Commons HttpClient plugin used in Jenkins core was actually a patched version of 3.x, not a 4.x.

See also https://openjdk.org/groups/net/httpclient/intro.html for an intorduction to the Java HTTP Client.

@betterphp
Copy link
Contributor

I've submitted a PR that fixes this, although based on the comments on https://issues.jenkins.io/browse/JENKINS-70253 it seems there's nobody to approved it :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants