-
1. Re: More NullPointerExceptions
cbrock Jun 18, 2012 1:49 PM (in response to mcasperson)What is the wire representation? Maybe it really is a JSON string. =)
-
2. Re: More NullPointerExceptions
mcasperson Jun 18, 2012 6:32 PM (in response to cbrock)Sorry - I should have been more specific. The object referenced by o is a JSONValue holding a string, which means that o.isObject() returns null.
-
3. Re: More NullPointerExceptions
cbrock Jun 18, 2012 6:46 PM (in response to mcasperson)That's correct. That is the correct behavior for the API. isObject() returns null if it is not an object, isString() returns null if it is not a string, and so on and so forth.
-
4. Re: More NullPointerExceptions
mcasperson Jun 18, 2012 7:30 PM (in response to cbrock)In my application the JSON being returned by a Jackson based REST service is throwing a NPE in this function because a string value is for some reason being passed to this function. I haven't had a chance to step through the code, but I'll see if I can created an isolated test case to demonstrate the issue.
-
5. Re: More NullPointerExceptions
mcasperson Jun 19, 2012 5:03 PM (in response to mcasperson)https://github.com/mcasperson/TestCase-RESTServer and https://github.com/mcasperson/TestCase-ErraiRESTClient demonstrate the bug. Jackson appears to serialize byte[] as strings, which seems to be causing the NPE above.
-
6. Re: More NullPointerExceptions
csa Jun 19, 2012 11:14 PM (in response to mcasperson)Yes, that's exactly the problem. Jackson makes the byte[] look like a String value to Errai's marshaller. However, using the latest snapshots you could replace your byte[] with a List<Byte> and it will work. I have to think more about how to support byte[] in our JacksonTransformer.
Thanks for reporting this!
-
7. Re: More NullPointerExceptions
csa Jun 21, 2012 4:39 PM (in response to csa)This has been fixed now. Jackson's native byte and char array representations are now understood by Errai's marshaller.