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

NoSuchMethodError after upgrade of json-io #1062

Closed
martinvisser opened this issue Mar 11, 2024 · 6 comments
Closed

NoSuchMethodError after upgrade of json-io #1062

martinvisser opened this issue Mar 11, 2024 · 6 comments

Comments

@martinvisser
Copy link

As mentioned in jdereg/json-io#274, a NoSuchMethodError is triggered after json-io was updated. Would be appreciated if the compatibility could be fixed.

@anthonydahanne
Copy link
Contributor

anthonydahanne commented Mar 11, 2024

Hello!
Thanks for bringing this to our attention!
I'm not sure to understand what you're trying to do though: 4.19.1 is the version we currently rely on, which did not break the API yet.
We haven't made any upgrade to the latest ones yet (4.19.4 at the moment)
Shouldn't we make the necessary java-cf-env changes when we start relying on those new versions? (instead of now)

@martinvisser
Copy link
Author

Hello @anthonydahanne, we upgraded the version ourselves, basically because there was an upgrade. During our builds we didn't have any issues, but whilst trying to deploy with the java-buildpack it failed with the aforementioned error.
So, I guess what I'm asking is if there are any plans to upgrade json-io. If that implies changes to java-cf-env then I guess that's where the change needs to be made?

@anthonydahanne
Copy link
Contributor

So, I guess what I'm asking is if there are any plans to upgrade json-io

eventually yes.
But honestly, for now, as long as there isn't any vulnerabilities or major features missing, there's no rush I believe.

If that implies changes to java-cf-env then I guess that's where the change needs to be made?

Yeah, according to your issue we'll have to change java-cf-env code (a minor upgrade I imagine)

A final note though: if you use java-cfenv-all, you'll notice that json-io is shaded into it; meaning you would not upgrade the version yourself (and you could actually ignore that dependency altogether) - maybe you have reasons not to use this "all in one" java-cfenv (the jar injected by the java-buildpack btw) , but in case you did not know about it, it's worth checking it I believe.

@martinvisser
Copy link
Author

We are using the following dependency in our maven project, which does not use the "all" version unfortunately:

        <dependency>
            <groupId>io.pivotal.spring.cloud</groupId>
            <artifactId>spring-cloud-services-starter-config-client</artifactId>
        </dependency>

This dependency brings in json-io:
image

We got a notification this version of json-io contains a CVE, which is the main reason we upgraded it in the first place.
Do you know if there is an alternative for the config-client starter which would use the shaded version perhaps? It doesn't really solve the CVE issue of course, but it would help with compatibility.

anthonydahanne added a commit to anthonydahanne/spring-cloud-services-starters that referenced this issue Mar 11, 2024
* between java-cfenv 3.1.3 and 3.1.5, one of its dependencies, `json-io` was upgraded to fix a CVE
* some users have started overriding spring-cloud-services-starters transitive dependencies to remove the CVE, see cloudfoundry/java-buildpack#1062 (comment)
anthonydahanne added a commit to anthonydahanne/spring-cloud-services-starters that referenced this issue Mar 11, 2024
* between java-cfenv 3.1.3 and 3.1.5, one of its dependencies, `json-io` was upgraded to fix a CVE
* some users have started overriding spring-cloud-services-starters transitive dependencies to remove the CVE, see cloudfoundry/java-buildpack#1062 (comment)
anthonydahanne added a commit to anthonydahanne/spring-cloud-services-starters that referenced this issue Mar 11, 2024
…dependencies, was upgraded to fix a CVE\n* some users have started overriding spring-cloud-services-starters transitive dependencies to remove the CVE, see cloudfoundry/java-buildpack#1062
anthonydahanne added a commit to anthonydahanne/spring-cloud-services-starters that referenced this issue Mar 11, 2024
* between java-cfenv 3.1.3 and 3.1.5, one of its dependencies, `json-io` was upgraded to fix a CVE
* some users have started overriding spring-cloud-services-starters transitive dependencies to remove the CVE, see cloudfoundry/java-buildpack#1062 (comment)
@anthonydahanne
Copy link
Contributor

anthonydahanne commented Mar 11, 2024

This dependency brings in json-io:

OK, then I guess the issue lies with https://github.com/pivotal-cf/spring-cloud-services-starters not consuming our latest release that relies on a java-cfenv free of CVEs

I've created this PR: pivotal-cf/spring-cloud-services-starters#406

Do you know if there is an alternative for the config-client starter which would use the shaded version perhaps? It doesn't really solve the CVE issue of course, but it would help with compatibility.

Hum, I don't know, we should ask them - cc @kvmw

kvmw pushed a commit to pivotal-cf/spring-cloud-services-starters that referenced this issue Mar 12, 2024
* between java-cfenv 3.1.3 and 3.1.5, one of its dependencies, `json-io` was upgraded to fix a CVE
* some users have started overriding spring-cloud-services-starters transitive dependencies to remove the CVE, see cloudfoundry/java-buildpack#1062 (comment)
@martinvisser
Copy link
Author

The author of json-io added the API back, so after upgrading to its latest version the issue is gone. I guess we can close this one as the work should be done in the starters anyway.

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

2 participants