You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by Dan Becker <da...@gmail.com> on 2008/08/08 18:32:37 UTC

Null JSON Writer returned from Writer Factory

Hello,

I am attempting to write an Abdera Entry object out as a JSON object 
using Abdera 0.4. I am using the following code:

    Abdera abdera = new Abdera();
    WriterFactory wf = abdera.getWriterFactory();
    Writer json = wf.getWriter("json");
    feedEntry.writeTo(json, System.out);

The third line here returns a null Writer object. When I debug a little 
into the WriterFactory, I see it contains a HashMap with only one object 
in there for the "prettyxml" key.

Is there some other initialization or configuration of Abdera I should 
do to enable the json Writer? Tips are apprciated.


-- 
Thanks, Dan Becker

Re: Null JSON Writer returned from Writer Factory

Posted by Dan Becker <da...@gmail.com>.
Dan Becker wrote:
> I am attempting to write an Abdera Entry object out as a JSON object 
> using Abdera 0.4. I am using the following code:
> 
>    Abdera abdera = new Abdera();
>    WriterFactory wf = abdera.getWriterFactory();
>    Writer json = wf.getWriter("json");
>    feedEntry.writeTo(json, System.out);
> 
> The third line here returns a null Writer object. When I debug a little 
> into the WriterFactory, I see it contains a HashMap with only one object 
> in there for the "prettyxml" key.
> 
> Is there some other initialization or configuration of Abdera I should 
> do to enable the json Writer? Tips are apprciated.
> 


Ahh, after further snooping I see the issue. I am running in Eclipse 
with explicit pointers to some but not all of the Abdera lib jars. After 
adding abdera-extensions-main and abdera-extensions-json, the extensions 
are registered, and available to my code. All now works as intended.

-- 
Thanks, Dan Becker

Re: Null JSON Writer returned from Writer Factory

Posted by David Calavera <da...@gmail.com>.
Have you registered the json extension?

El 08/08/2008, a las 18:32, Dan Becker <da...@gmail.com>  
escribió:

> Hello,
>
> I am attempting to write an Abdera Entry object out as a JSON object  
> using Abdera 0.4. I am using the following code:
>
>   Abdera abdera = new Abdera();
>   WriterFactory wf = abdera.getWriterFactory();
>   Writer json = wf.getWriter("json");
>   feedEntry.writeTo(json, System.out);
>
> The third line here returns a null Writer object. When I debug a  
> little into the WriterFactory, I see it contains a HashMap with only  
> one object in there for the "prettyxml" key.
>
> Is there some other initialization or configuration of Abdera I  
> should do to enable the json Writer? Tips are apprciated.
>
>
> -- 
> Thanks, Dan Becker