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

CUSTOM-54: NullPointerException when JMX attribute is null #4365

Merged
merged 3 commits into from
Dec 6, 2019
Merged

CUSTOM-54: NullPointerException when JMX attribute is null #4365

merged 3 commits into from
Dec 6, 2019

Conversation

rdebusscher
Copy link

CUSTOM-54: NullPointerException when JMX attribute is null within the rest-monitoring endpoint

Description

This is a bug fix

When JMX attributes are null, it results in NPE when accessed from the rest-monitoring endpoint.

The fix checks if the attribute value is null and return JsonValue.NULL in that case instead of the 'generic' method who tries to convert the instance to a JsonValue.

Testing

Testing Performed

Manual testing

Testing Environment

Oracle 1.8.0_181 on Mac 10.14.6 with Maven 3.5.4

Documentation

N/A

@rdebusscher
Copy link
Author

@MarkWareham Added Unit tests

Copy link
Contributor

@dmatej dmatej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test was successful, not sure with AssertJ usage, but ok.

<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.1</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the same version and from jakarta as

Payara/pom.xml

Line 186 in 2e6edd2

<jsonp.version>1.1.5</jsonp.version>

seems to be used for example in
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.json</artifactId>
<version>${jsonp.version}</version>
</dependency>

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though the org.glassfish:jakarta.json pointed to the API, and not an actual implementation., as only the API artifacts should be 'jakartified'.
Fixed in new commit.

@rdebusscher
Copy link
Author

jenkins test please

@rdebusscher rdebusscher merged commit c8666a2 into payara:master Dec 6, 2019
@rdebusscher rdebusscher deleted the CUSTCOM-54 branch December 12, 2019 07:34
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

Successfully merging this pull request may close these issues.

5 participants