abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James M Snell <jasn...@gmail.com>
Subject Re: abdera and mod_atom unexpected EOF in prolog
Date Tue, 27 Nov 2007 18:10:22 GMT


Doug Fils wrote:
> All,
>   I'm new to the list but my review of the archives didn't show anything on
> this.  Hopefully it's not a repeat I missed.
> 
> I am installed the mod_atom server by Tim Brey from
> http://www.tbray.org/ongoing/When/200x/2007/06/25/mod_atom
> and http://code.google.com/p/mod-atom/
> 
> Using the Main.java code from the examples ... appclient directory I can
> easily post entries to this server and parse feed entry lists.  However, I
> ran into two issues.
> 
> 1)  Attempt to PUT to '[REMOVED]' without an If-Match header
> 
> Adding in a:
>  RequestOptions requestOptions = new RequestOptions();
>   requestOptions.setIfMatch("tag:example.org,2006:foo");
> then
> doc = abderaClient.get(editUri.toString(), requestOptions).getDocument();
> 
> resolved this..  though I am totally not sure using the tag string means
> anything here.  Indeed this may be why I am getting error 2
> 

Tim made the choice to require conditionals for every request, even
delete.  This ensures that the client only makes changes to known resources.

> 2) Exception in thread "main" org.apache.abdera.parser.ParseException:
> org.apache.abdera.parser.ParseException: com.ctc.wstx.exc.WstxEOFException:
> Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
>     at org.apache.abdera.protocol.client.AbstractClientResponse.getDocument(
> AbstractClientResponse.java:102)
>     at org.apache.abdera.protocol.client.AbstractClientResponse.getDocument(
> AbstractClientResponse.java:73)
>     at org.apache.abdera.protocol.client.AbstractClientResponse.getDocument(
> AbstractClientResponse.java:61)
>     at Main.main(Main.java:66)
> 
> This seems to happen at the line:
> doc = abderaClient.get(editUri.toString(), requestOptions).getDocument();
> 

The response likely does not contain a parseable document.  You need to
check the response status code and media type before attempting to call
getDocument().

> Is request options supposed to be required by a server?  Ie is this an issue
> with mod_atom and not abdera?
> 

It is up to the server.  mod_atom is operating correctly; clients just
need to be aware of various implementation details of the server.  When
it doubt, if an Etag is available, use it.

- James

> Any help, insight, etc, would be greatly appreciated.
> 
> Thanks
> Doug
> 

Mime
View raw message