KubernetesResourceUtil: Replace deprecated usage of JsonMappingException constructor

See original GitHub issue

Description

In KubernetesResourceUtil.readFragment method, we’re using this constructor for JsonMappingException: https://github.com/eclipse/jkube/blob/a49aff150d4cee4cba39c2305e8096721444d0c3/jkube-kit/enricher/api/src/main/java/org/eclipse/jkube/kit/enricher/api/util/KubernetesResourceUtil.java#L383

This has been marked deprecated as per latest Jackson Databind documentation. We can use the static methods for creating exceptions:

throw JsonMappingException.from(mapper.getDeserializationContext(), String.format("[%s] %s", file, e.getMessage()));

Before you start

Make sure you read the contributing guide first. Pay special attention to the ECA agreement section and the requirement to sign-off your commit.

How to manually test my changes

Kubernetes

If you don’t have a real Kubernetes cluster available (most probably), you can use Minikube or Kind to test with a local cluster.

OpenShift

If you don’t have a real OpenShift cluster available (most probably), you can use Red Hat’s developer Sandbox for Red Hat OpenShift. The only requirement is to have a Red Hat account.

Once you have your Sandbox environment, you’ll need to download the oc tool from the cluster console. (Press the ? icon and from the context menu select Command line tools, you’ll be redirected to https://$subdomain.openshiftapps.com/command-lines-tools where you’ll be able to download the CLI for your platform)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rohanKanojiacommented, Dec 6, 2021

@shivkushwaha1511 : Thanks for showing interest. I’ll create one issue and let you know

1reaction
rohanKanojiacommented, Dec 6, 2021

@shivkushwaha1511 : I think we can close this issue. Shall I create some other good first issue for you? Would you be willing to work on that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

JsonMappingException (jackson-databind 2.7.0 API)
Checked exception used to signal fatal problems with mapping of content, distinct from low-level I/O problems (signaled using simple IOException s) or data ......
Read more >
Deprecated List (jackson-databind 2.8.5 API) - Javadoc.io
Since 2.5: replaced by a fluent form of the method; ObjectMapper.addMixIn(Class, Class) . com.fasterxml.jackson.databind.deser.impl.CreatorCollector.
Read more >
No suitable constructor found for type [simple type, class ]: can ...
JsonMappingException : No suitable constructor found for type [simple type, class com.myweb.ApplesDO]: can not instantiate from JSON object (need to add/enable ...
Read more >
Class JsonMappingException
Checked exception used to signal fatal problems with mapping of content, distinct from low-level I/O problems (signaled using simple IOException s) or data ......
Read more >
Jackson Exceptions - Problems and Solutions - Baeldung
Use Jackson to map custom JSON to any java entity graph with full control over the ... 3. JsonMappingException: No Suitable Constructor ......
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