Report query against CalendarServer always returns [] with "REPORT request body may not be empty" error

42 views
Skip to first unread message

s.kris

unread,
May 6, 2011, 3:31:49 AM5/6/11
to caldav4j
Using snapshot 0.7 latest build with maven.
The server seems to be finding the request body to be empty, but it's
not.
I'm trying to look up *all* events from my calendar (on the Darwin
CalendarServer) but am getting an empty set preceeded by the error
"Request body cannot be empty".
Here's the code:
<code>
log.info("Filter: VEVENT");
GenerateQuery gq = new GenerateQuery();
log.info(printQuery(gq.generate()));
gq = new GenerateQuery(null,Component.VEVENT);
log.info(printQuery(gq.generate())); //prints good request

CalDAVCollection col = new CalDAVCollection();
col.setHostConfiguration(calendarClient.hostConfig);
col.setMethodFactory(new CalDAV4JMethodFactory());
col.setCalendarCollectionRoot("/calendars/__uids__/skris/
calendar");
List<Calendar> cals = col.queryCalendars(calendarClient,
gq.generate());
log.info(cals);// this is empty
</code>


Here is the server output:

<?xml version="1.0"?>
<C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:prop xmlns:D="DAV:">
<D:getetag/>
<D:allprop/>
<C:calendar-data>
<C:comp name="VCALENDAR"/>
</C:calendar-data>
</D:prop>
<C:filter>
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT"/>
</C:comp-filter>
</C:filter>
</C:calendar-query>

ical4j.properties not found.
Preemptively sending default basic credentials
Authenticating with BASIC <any realm>@hp-touch.me.com:8008
Credential charset not configured, using HTTP element charset
Open connection to hp-touch.me.com:8008
>> "REPORT /calendars/__uids__/skris/calendar/ HTTP/1.1[\r][\n]"
Adding Host request header
>> "Authorization: Basic bXljYXJlOm15Y2FyZQ==[\r][\n]"
>> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
>> "Host: hp-touch.me.org:8008[\r][\n]"
>> "Depth: 1[\r][\n]"
>> "Content-Type: text/xml[\r][\n]"
>> "[\r][\n]"
Default charset used: ISO-8859-1
<< "HTTP/1.1 400 Bad Request[\r][\n]"
<< "HTTP/1.1 400 Bad Request[\r][\n]"
<< "Date: Thu, 05 May 2011 23:34:24 GMT[\r][\n]"
<< "DAV: 1, access-control, calendar-access, calendar-schedule,
calendar-auto-schedule, calendar-availability, inbox-availability,
calendar-proxy, calendarserver-private-events, calendarserver-private-
comments, calendarserver-principal-property-search[\r][\n]"
<< "Content-Type: text/html[\r][\n]"
<< "Content-Length: 128[\r][\n]"
<< "Server: Twisted/8.2.0 TwistedWeb/8.2.0 TwistedCalDAV/?[\r][\n]"
<< "[\r][\n]"
<< "<html><head><title>Bad Request</title></head><body><h1>Bad
Request</h1><p>REPORT request body may not be empty</p></body></html>"
Resorting to protocol version default close connection policy
Should NOT close connection, using HTTP/1.1
Connection is locked. Call to releaseConnection() ignored.
Releasing connection back to connection manager.
Server returned null

Roberto Polli

unread,
May 6, 2011, 4:25:17 AM5/6/11
to cald...@googlegroups.com
2011/5/6 s.kris <shruti.kr...@gmail.com>:

> Using snapshot 0.7 latest build with maven.
Your code seems ok. Try debugging with eclipse.

Do you successfully run junit test cases? A strongly suggest to do so.
They almost worked with Apple CalendarServer...
Peace,
R:

s.kris

unread,
May 10, 2011, 3:49:32 AM5/10/11
to caldav4j
The error was due to having incorrect webdav lib. I need to wrap my
head around maven..


On May 6, 1:25 am, Roberto Polli <robipo...@gmail.com> wrote:
> 2011/5/6 s.kris <shruti.krishnag...@gmail.com>:> Using snapshot 0.7 latest build with maven.

rahul...@actovoice.com

unread,
Sep 14, 2017, 12:54:32 PM9/14/17
to caldav4j
Using caldav4j.

I was able to access calendars using Calda4j, but maybe update of ical4j is causing some errors.

I am getting empty list of calendars.

Need help.

Roberto Polli

unread,
Sep 15, 2017, 3:24:33 AM9/15/17
to cald...@googlegroups.com
Hi Rahul,



2017-09-14 6:59 GMT+02:00 <rahul...@actovoice.com>:
> I am getting empty list of calendars.
Can you post the request and response of your server?

Which version of caldav4j are you using? Which caldav server?

Did you try to run the junit test against your server to check if it
supports all the functionalities?

RAHUL DATE

unread,
Nov 10, 2017, 3:07:18 AM11/10/17
to caldav4j
Above rahul...@actovoice is also my account, I was able to get the list, thanks
Reply all
Reply to author
Forward
0 new messages