You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by Ady Das OToole <ad...@optaros.com> on 2007/05/16 20:20:32 UTC

Re: Roller (atom) app - Propono

So I'm trying to use the ClientAtomService hooked up to my Roller app 
feed and I get a null pointer exception in the Propono code when I try 
to do the following:
 ClientAtomService service = AtomClientFactory.getAtomService(endpoint, 
username, password);

Looking at my app feed I see the following, which is different from the 
example of Roller app feeds that I  see on the web (the "app:" prefix on 
the nodes). Anyway, I don't see how that would cause the error - but any 
help would be brilliant!

(And thanks Dave for sorting out my app feed)

<?xml version="1.0" encoding="UTF-8"?>
<app:service xmlns:app="http://purl.org/atom/app#">
  <app:workspace>
    <atom:title xmlns:atom="http://www.w3.org/2005/atom">Test</atom:title>
    <app:collection 
href="http://<server>:<port>/roller/roller-services/app/test/entries">
      <atom:title xmlns:atom="http://www.w3.org/2005/atom">Weblog 
Entries</atom:title>
      <app:categories app:fixed="yes" 
app:scheme="http://<server>:<port>/roller/edn/">
        <atom:category xmlns:atom="http://www.w3.org/2005/atom" 
atom:term="/Test" atom:label="Test" />
      </app:categories>
      <app:accept>entry</app:accept>
    </app:collection>
    <app:collection 
href="http://http://<server>:<port>/roller/roller-services/app/test/resources">
      <atom:title xmlns:atom="http://www.w3.org/2005/atom">Media 
Files</atom:title>
      <app:accept />
    </app:collection>
  </app:workspace>
</app:service>

-- 
Ady Das-OToole


Re: Roller (atom) app - Propono

Posted by Ady Das OToole <ad...@optaros.com>.
Roller 3.1, and yeah the u/c "A" does seem to be the issue, I changed 
the propono client code and it works fine now

Thanks again for your help

A

Dave wrote:
> On 5/16/07, Ady Das OToole <ad...@optaros.com> wrote:
>> This is the element content that goes into that parseWorkspaceElement()
>> method - would the u/c "A" in ..2005/Atom make a difference?
>>
>>
>> [[Text:
>>     ], [Element: <atom:title [Namespace:
>> http://www.w3.org/2005/atom]/>], [Text:
>>     ], [Element: <app:collection [Namespace:
>> http://purl.org/atom/app#]/>], [Text:
>>     ], [Element: <app:collection [Namespace:
>> http://purl.org/atom/app#]/>], [Text:
>>   ]]
>>
>> Ady Das OToole wrote:
>> > I debugged the error to this line in
>> > ...propono.atom.client.ClientWorkspace parseWorkspaceElement(Element
>> > element){}
>> > Element titleElem = element.getChild("title", 
>> AtomService.ATOM_FORMAT);
>> > //Ady comments -> AtomService.ATOM_FORMAT = [Namespace: prefix "atom"
>> > is mapped to URI "http://www.w3.org/2005/Atom"]
>> > //Ady comments -> titleElem = null
>> >
>> > setTitle(titleElem.getText()); //<- the exception is here
>
> That could be the problem. By the way, are you using Roller 3.1 or 
> Roller trunk?
>
> - Dave
>

-- 
Ady Das-OToole
Optaros, Inc.
617-227-1855 x113 (p)
617-227-1755 (f)
617-217-1041 (m)
adasotoole@optaros.com
www.optaros.com


Re: Roller (atom) app - Propono

Posted by Dave <sn...@gmail.com>.
On 5/16/07, Ady Das OToole <ad...@optaros.com> wrote:
> This is the element content that goes into that parseWorkspaceElement()
> method - would the u/c "A" in ..2005/Atom make a difference?
>
>
> [[Text:
>     ], [Element: <atom:title [Namespace:
> http://www.w3.org/2005/atom]/>], [Text:
>     ], [Element: <app:collection [Namespace:
> http://purl.org/atom/app#]/>], [Text:
>     ], [Element: <app:collection [Namespace:
> http://purl.org/atom/app#]/>], [Text:
>   ]]
>
> Ady Das OToole wrote:
> > I debugged the error to this line in
> > ...propono.atom.client.ClientWorkspace parseWorkspaceElement(Element
> > element){}
> > Element titleElem = element.getChild("title", AtomService.ATOM_FORMAT);
> > //Ady comments -> AtomService.ATOM_FORMAT = [Namespace: prefix "atom"
> > is mapped to URI "http://www.w3.org/2005/Atom"]
> > //Ady comments -> titleElem = null
> >
> > setTitle(titleElem.getText()); //<- the exception is here

That could be the problem. By the way, are you using Roller 3.1 or Roller trunk?

- Dave

Re: Roller (atom) app - Propono

Posted by Ady Das OToole <ad...@optaros.com>.
This is the element content that goes into that parseWorkspaceElement() 
method - would the u/c "A" in ..2005/Atom make a difference?


[[Text:
    ], [Element: <atom:title [Namespace: 
http://www.w3.org/2005/atom]/>], [Text:
    ], [Element: <app:collection [Namespace: 
http://purl.org/atom/app#]/>], [Text:
    ], [Element: <app:collection [Namespace: 
http://purl.org/atom/app#]/>], [Text:
  ]]

Ady Das OToole wrote:
> I debugged the error to this line in
> ...propono.atom.client.ClientWorkspace parseWorkspaceElement(Element 
> element){}
> Element titleElem = element.getChild("title", AtomService.ATOM_FORMAT);
> //Ady comments -> AtomService.ATOM_FORMAT = [Namespace: prefix "atom" 
> is mapped to URI "http://www.w3.org/2005/Atom"]
> //Ady comments -> titleElem = null
>
> setTitle(titleElem.getText()); //<- the exception is here
>
>
>
>
> java.lang.NullPointerException
>    at 
> com.sun.syndication.propono.atom.client.ClientWorkspace.parseWorkspaceElement(ClientWorkspace.java:50) 
>
>    at 
> com.sun.syndication.propono.atom.client.ClientWorkspace.<init>(ClientWorkspace.java:43) 
>
>    at 
> com.sun.syndication.propono.atom.client.ClientAtomService.parseAtomServiceDocument(ClientAtomService.java:139) 
>
>    at 
> com.sun.syndication.propono.atom.client.ClientAtomService.<init>(ClientAtomService.java:97) 
>
>    at 
> com.sun.syndication.propono.atom.client.AtomClientFactory.getAtomService(AtomClientFactory.java:33) 
>
>    at com.test.atom.EntryReader.getAtomService(EntryReader.java:34)
>    at com.test.atom.EntryReader.main(EntryReader.java:24)
>
> Dave wrote:
>> Do you have a stack trace for that NPE?
>>
>> - Dave
>>
>>
>>
>> On 5/16/07, Ady Das OToole <ad...@optaros.com> wrote:
>>> So I'm trying to use the ClientAtomService hooked up to my Roller app
>>> feed and I get a null pointer exception in the Propono code when I try
>>> to do the following:
>>>  ClientAtomService service = AtomClientFactory.getAtomService(endpoint,
>>> username, password);
>>>
>>> Looking at my app feed I see the following, which is different from the
>>> example of Roller app feeds that I  see on the web (the "app:" 
>>> prefix on
>>> the nodes). Anyway, I don't see how that would cause the error - but 
>>> any
>>> help would be brilliant!
>>>
>>> (And thanks Dave for sorting out my app feed)
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <app:service xmlns:app="http://purl.org/atom/app#">
>>>   <app:workspace>
>>>     <atom:title 
>>> xmlns:atom="http://www.w3.org/2005/atom">Test</atom:title>
>>>     <app:collection
>>> href="http://<server>:<port>/roller/roller-services/app/test/entries">
>>>       <atom:title xmlns:atom="http://www.w3.org/2005/atom">Weblog
>>> Entries</atom:title>
>>>       <app:categories app:fixed="yes"
>>> app:scheme="http://<server>:<port>/roller/edn/">
>>>         <atom:category xmlns:atom="http://www.w3.org/2005/atom"
>>> atom:term="/Test" atom:label="Test" />
>>>       </app:categories>
>>>       <app:accept>entry</app:accept>
>>>     </app:collection>
>>>     <app:collection
>>> href="http://http://<server>:<port>/roller/roller-services/app/test/resources"> 
>>>
>>>       <atom:title xmlns:atom="http://www.w3.org/2005/atom">Media
>>> Files</atom:title>
>>>       <app:accept />
>>>     </app:collection>
>>>   </app:workspace>
>>> </app:service>
>>>
>>> -- 
>>> Ady Das-OToole
>>>
>>>
>>
>

-- 
Ady Das-OToole
Optaros, Inc.
617-227-1855 x113 (p)
617-227-1755 (f)
617-217-1041 (m)
adasotoole@optaros.com
www.optaros.com


Re: Roller (atom) app - Propono

Posted by Ady Das OToole <ad...@optaros.com>.
I debugged the error to this line in
...propono.atom.client.ClientWorkspace parseWorkspaceElement(Element 
element){}
Element titleElem = element.getChild("title", AtomService.ATOM_FORMAT);
//Ady comments -> AtomService.ATOM_FORMAT = [Namespace: prefix "atom" is 
mapped to URI "http://www.w3.org/2005/Atom"]
//Ady comments -> titleElem = null

setTitle(titleElem.getText()); //<- the exception is here




java.lang.NullPointerException
    at 
com.sun.syndication.propono.atom.client.ClientWorkspace.parseWorkspaceElement(ClientWorkspace.java:50)
    at 
com.sun.syndication.propono.atom.client.ClientWorkspace.<init>(ClientWorkspace.java:43)
    at 
com.sun.syndication.propono.atom.client.ClientAtomService.parseAtomServiceDocument(ClientAtomService.java:139)
    at 
com.sun.syndication.propono.atom.client.ClientAtomService.<init>(ClientAtomService.java:97)
    at 
com.sun.syndication.propono.atom.client.AtomClientFactory.getAtomService(AtomClientFactory.java:33)
    at com.test.atom.EntryReader.getAtomService(EntryReader.java:34)
    at com.test.atom.EntryReader.main(EntryReader.java:24)

Dave wrote:
> Do you have a stack trace for that NPE?
>
> - Dave
>
>
>
> On 5/16/07, Ady Das OToole <ad...@optaros.com> wrote:
>> So I'm trying to use the ClientAtomService hooked up to my Roller app
>> feed and I get a null pointer exception in the Propono code when I try
>> to do the following:
>>  ClientAtomService service = AtomClientFactory.getAtomService(endpoint,
>> username, password);
>>
>> Looking at my app feed I see the following, which is different from the
>> example of Roller app feeds that I  see on the web (the "app:" prefix on
>> the nodes). Anyway, I don't see how that would cause the error - but any
>> help would be brilliant!
>>
>> (And thanks Dave for sorting out my app feed)
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <app:service xmlns:app="http://purl.org/atom/app#">
>>   <app:workspace>
>>     <atom:title 
>> xmlns:atom="http://www.w3.org/2005/atom">Test</atom:title>
>>     <app:collection
>> href="http://<server>:<port>/roller/roller-services/app/test/entries">
>>       <atom:title xmlns:atom="http://www.w3.org/2005/atom">Weblog
>> Entries</atom:title>
>>       <app:categories app:fixed="yes"
>> app:scheme="http://<server>:<port>/roller/edn/">
>>         <atom:category xmlns:atom="http://www.w3.org/2005/atom"
>> atom:term="/Test" atom:label="Test" />
>>       </app:categories>
>>       <app:accept>entry</app:accept>
>>     </app:collection>
>>     <app:collection
>> href="http://http://<server>:<port>/roller/roller-services/app/test/resources"> 
>>
>>       <atom:title xmlns:atom="http://www.w3.org/2005/atom">Media
>> Files</atom:title>
>>       <app:accept />
>>     </app:collection>
>>   </app:workspace>
>> </app:service>
>>
>> -- 
>> Ady Das-OToole
>>
>>
>

-- 
Ady Das-OToole
Optaros, Inc.
617-227-1855 x113 (p)
617-227-1755 (f)
617-217-1041 (m)
adasotoole@optaros.com
www.optaros.com


Re: Roller (atom) app - Propono

Posted by Dave <sn...@gmail.com>.
Do you have a stack trace for that NPE?

- Dave



On 5/16/07, Ady Das OToole <ad...@optaros.com> wrote:
> So I'm trying to use the ClientAtomService hooked up to my Roller app
> feed and I get a null pointer exception in the Propono code when I try
> to do the following:
>  ClientAtomService service = AtomClientFactory.getAtomService(endpoint,
> username, password);
>
> Looking at my app feed I see the following, which is different from the
> example of Roller app feeds that I  see on the web (the "app:" prefix on
> the nodes). Anyway, I don't see how that would cause the error - but any
> help would be brilliant!
>
> (And thanks Dave for sorting out my app feed)
>
> <?xml version="1.0" encoding="UTF-8"?>
> <app:service xmlns:app="http://purl.org/atom/app#">
>   <app:workspace>
>     <atom:title xmlns:atom="http://www.w3.org/2005/atom">Test</atom:title>
>     <app:collection
> href="http://<server>:<port>/roller/roller-services/app/test/entries">
>       <atom:title xmlns:atom="http://www.w3.org/2005/atom">Weblog
> Entries</atom:title>
>       <app:categories app:fixed="yes"
> app:scheme="http://<server>:<port>/roller/edn/">
>         <atom:category xmlns:atom="http://www.w3.org/2005/atom"
> atom:term="/Test" atom:label="Test" />
>       </app:categories>
>       <app:accept>entry</app:accept>
>     </app:collection>
>     <app:collection
> href="http://http://<server>:<port>/roller/roller-services/app/test/resources">
>       <atom:title xmlns:atom="http://www.w3.org/2005/atom">Media
> Files</atom:title>
>       <app:accept />
>     </app:collection>
>   </app:workspace>
> </app:service>
>
> --
> Ady Das-OToole
>
>