You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@abdera.apache.org by David Calavera <da...@gmail.com> on 2008/11/01 07:10:46 UTC

Re: JSON Null Pointer Exception

Philip, could you open a ticket in our jira including the full stacktrace?
I'll take a look when I'll go back home.
Thank you.

On Mon, Oct 27, 2008 at 9:49 PM, pdk <pd...@gmail.com> wrote:

> I have an entry that has the following format:
>
> <content type="text/xml" src="http://someurl/foo.xml" />
>
> actual content is stored at some other URL.
>
>
> In the JSON extension, when trying to write the entry with the above
> content element, the JSONStream.writeQuoted method causes a null
> pointer exception.
>
>  public void writeQuoted(String value) throws IOException {
>    writer.write('"');
>    writer.write(escape(value));
>    writer.write('"');
>    writer.flush();
>  }
>
>
>  private static String escape(String value) {
>    if (value == null) return null;
> // snip
>
> A snippet of the stack is (sorry had to retype b/c error is on a private
> system)
>
> Writer.java:140
> writeQuoted(JSONStream.java:116)
> toJson(JSONUtil.java:166)
> writeElement(JSONUtil.java:541)
> toJson(JSONUtil.java:236)
> writeList(JSONUtil.java:557)
> toJson(JSONUtil.java:321)
>



-- 
David Calavera
http://www.thinkincode.net