question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NoSuchMethodError: old Apache library loaded in Gradle build environment

See original GitHub issue

Environment:

  • Jib version: 1.8.0
  • Build tool: Gradle 5.4.1
  • OS: OSX 10.14.6

Description of the issue: When trying to run gradle jibDockerBuild with the jib gradle plugin v1.8.0, I got a very confusing error message with no results on Google:

> com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: org.apache.http.client.config.RequestConfig$Builder.setNormalizeUri(Z)Lorg/apache/http/client/config/RequestConfig$Builder;

Expected behavior: When running the same command with the jib plugin v1.7.0, I get this much more helpful error message:

Steps to reproduce:

1. Kill the docker daemon 2. Add the jib gradle plugin v1.8.0 to a gradle build 3. Run gradle jibDockerBuild

jib-gradle-plugin Configuration:

plugins {
    id 'com.google.cloud.tools.jib' version '1.8.0'
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

7reactions
loosebazookacommented, Dec 5, 2019

I think you can ask the parent to load in the jib plugin in the parent but not apply it (apply false), so the classpaths are correct?

plugins {
  id 'com.google.cloud.tools.jib' version '1.8.0' apply false
}

and then use the plugin in your subproject (you can omit the version since it’s specified above)

plugins {
  id 'com.google.cloud.tools.jib
}

Can you see if that works? If not, there’s the option of just adding the httpclient at the right version to the buildscript classpath in the root project.

1reaction
edobrycommented, Dec 5, 2019

That did indeed fix the issue, thanks! May be useful to add this tip to documentation or troubleshooting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fix a NoSuchMethodError? - java - Stack Overflow
To solve it I checked, firstly, Module Dependency Diagram ( click in your POM the combination -> Ctrl+Alt+Shift+U or right click in your...
Read more >
3 Steps to Fix NoSuchMethodErrors and ...
A NoSuchMethodError occurs when we're calling a method that does not exist at runtime. The method must have existed at compile time, ...
Read more >
Upgrading your build from Gradle 5.x to 6.0
Try running gradle help --scan and view the deprecations view of the generated build scan. Deprecations View of a Gradle Build Scan. This...
Read more >
Importing a Gradle project fails with an exception in the latest ...
You should check with a ./gradlew clean build that all dependencies are correctly resolved.
Read more >
Building applications with Maven - Quarkus
This should only be used in a development environment. You should not run production application in dev mode. To do this you must...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found