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
Jolokia can't serialize TabularDataSupport with empty set of rows. In this case value field in the HTTP response contains null value:
TabularDataSupport
value
null
{"timestamp":1433455091,"status":200,"request":{"mbean":"helloworld:type=SimpleMBean","attribute":"simpleAttribute","type":"read"},"value":null}
I found the reason. Look at this line of code: TabularDataExtractor.java L200
When TabularData is empty the loop never iterates and found local variable will set to false. So AttributeFilteredException will cause to unwind call stack and catched in ObjectToJsonConverter.extractObjectWithContext method.
TabularData
found
false
AttributeFilteredException
ObjectToJsonConverter.extractObjectWithContext
try { jsonResult = extractObject(pValue, pExtraArgs, pJsonify); } catch (ValueFaultHandler.AttributeFilteredException exp) { jsonResult = null; } finally { clearContext(); }
Here, jsonResult always set to null if AttributeFilteredException exception occurred.
jsonResult
The text was updated successfully, but these errors were encountered:
Unable to serialize empty TabularData rhuss#200
73afe34
- empty TabularData -> empty JSON object
Hi,
I assumed that empty TabularData should respond to empty JSON object. Fix is nevenr@73afe34. This commit will be included in #220.
Regards, N.
Sorry, something went wrong.
Cleaned up a bit fix for #200
771f4f6
and added to changes.xml
#200: Add unit test and additional fix for MXBeans
9fb54f9
Fixed in master
No branches or pull requests
Jolokia can't serialize
TabularDataSupport
with empty set of rows. In this casevalue
field in the HTTP response containsnull
value:I found the reason. Look at this line of code:
TabularDataExtractor.java L200
When
TabularData
is empty the loop never iterates andfound
local variable will set tofalse
. SoAttributeFilteredException
will cause to unwind call stack and catched inObjectToJsonConverter.extractObjectWithContext
method.Here,
jsonResult
always set tonull
ifAttributeFilteredException
exception occurred.The text was updated successfully, but these errors were encountered: