graviox/Roundcube-CardDAV — Issue #3: nullpointer exception when saving configuration
Author: tonytone
Created: 2011-11-28 16:30:24+00:00
State: open

Hi there,

I downloaded your plugin for more or less the same reasons why you wrote it; The existing plugin for RoundCube just doesn't perform well at all. Unfortunately I've been having difficulties getting this plugin to run properly. My environment as it is setup at the moment contains an exchange 2007 server for mail a carddav "gateway" and RoundCube loaded with your plugin. This setup appears to work properly with both iCal and Addressbook on OSX Lion connecting to both the exchange calendar and addressbook respectively thru the carddav gateway.

While analyzing the gateway logs the fallowing errors caught my attention;
- HTTP/1.1 503 Service Unavailable
- Public folders not available: 401 Unauthorized

However it is unclear to me which service the plugin is trying to contact that returns the 503 and if the 401 could still be causing this issue since it is only a warning and the process seems to continue. https://exchange./ews/exchange.asmx returns a login prompt that accepts the same credentials also provided to the plugin and returns an XML as expected. I hope you are able and willing to help me debug this issue I have pasted my logs below.

Thanks in advance!
Tony

---------------------------

O/S: FreeBSD 8.2
Mail Server: MS Exchange 2007
Carddav Gateway: DAVMail 3.9.4
Carddav Client: Roundcube-CardDAV-0.2-7
Roundcube: 0.6

davmail error log:
[davmail.caldav.CaldavServer] davmail - Connection from /192.168.0.9 on port 1080
[CaldavConnection-17744] davmail - < OPTIONS /users/@/contacts/ HTTP/1.1
DEBUG [CaldavConnection-17744] davmail - < User-Agent: CardDAV-PHP/0.4.4
DEBUG [CaldavConnection-17744] davmail - < Host: dev.:1080
DEBUG [CaldavConnection-17744] davmail - < Accept: */*
DEBUG [CaldavConnection-17744] davmail - > HTTP/1.1 200 OK
DEBUG [CaldavConnection-17744] davmail - > Server: DavMail Gateway 3.9.4-trunk
DEBUG [CaldavConnection-17744] davmail - > DAV: 1, calendar-access, calendar-schedule, calendarserver-private-events, addressbook
DEBUG [CaldavConnection-17744] davmail - > Date: Mon, 28 Nov 2011 15:24:19 +0000
DEBUG [CaldavConnection-17744] davmail - > Expires: Mon, 28 Nov 2011 15:24:19 +0000
DEBUG [CaldavConnection-17744] davmail - > Cache-Control: private, max-age=0
DEBUG [CaldavConnection-17744] davmail - > Allow: OPTIONS, PROPFIND, HEAD, GET, REPORT, PROPPATCH, PUT, DELETE, POST
DEBUG [CaldavConnection-17744] davmail - > Connection: keep-alive
DEBUG [CaldavConnection-17744] davmail - > Content-Length: 0
DEBUG [CaldavConnection-17744] davmail - >
DEBUG [davmail.caldav.CaldavServer] davmail - Connection from /192.168.0.9 on port 1080
DEBUG [CaldavConnection-19844] davmail - < OPTIONS /users/@/contacts/ HTTP/1.1
DEBUG [CaldavConnection-19844] davmail - < User-Agent: CardDAV-PHP/0.4.4
DEBUG [CaldavConnection-19844] davmail - < Host: dev.:1080
DEBUG [CaldavConnection-19844] davmail - < Accept: */*
DEBUG [CaldavConnection-19844] davmail - > HTTP/1.1 200 OK
DEBUG [CaldavConnection-19844] davmail - > Server: DavMail Gateway 3.9.4-trunk
DEBUG [CaldavConnection-19844] davmail - > DAV: 1, calendar-access, calendar-schedule, calendarserver-private-events, addressbook
DEBUG [CaldavConnection-19844] davmail - > Date: Mon, 28 Nov 2011 15:24:19 +0000
DEBUG [CaldavConnection-19844] davmail - > Expires: Mon, 28 Nov 2011 15:24:19 +0000
DEBUG [CaldavConnection-19844] davmail - > Cache-Control: private, max-age=0
DEBUG [CaldavConnection-19844] davmail - > Allow: OPTIONS, PROPFIND, HEAD, GET, REPORT, PROPPATCH, PUT, DELETE, POST
DEBUG [CaldavConnection-19844] davmail - > Connection: keep-alive
DEBUG [CaldavConnection-19844] davmail - > Content-Length: 0
DEBUG [CaldavConnection-19844] davmail - >
DEBUG [davmail.caldav.CaldavServer] davmail - Connection from /192.168.0.9 on port 1080
DEBUG [CaldavConnection-21936] davmail - < PROPFIND /users/@/contacts/ HTTP/1.1
DEBUG [CaldavConnection-21936] davmail - < User-Agent: CardDAV-PHP/0.4.4
DEBUG [CaldavConnection-21936] davmail - < Host: dev.:1080
DEBUG [CaldavConnection-21936] davmail - < Accept: */*
DEBUG [CaldavConnection-21936] davmail - > HTTP/1.1 401 Unauthorized
DEBUG [CaldavConnection-21936] davmail - > WWW-Authenticate: Basic realm="DavMail Gateway"
DEBUG [CaldavConnection-21936] davmail - > Connection: keep-alive
DEBUG [CaldavConnection-21936] davmail - > Content-Length: 0
DEBUG [CaldavConnection-21936] davmail - >
DEBUG [CaldavConnection-21936] davmail - < PROPFIND /users/@/contacts/ HTTP/1.1
DEBUG [CaldavConnection-21936] davmail - < Authorization: ********
DEBUG [CaldavConnection-21936] davmail - < User-Agent: CardDAV-PHP/0.4.4
DEBUG [CaldavConnection-21936] davmail - < Host: dev.:1080
DEBUG [CaldavConnection-21936] davmail - < Accept: */*
DEBUG [CaldavConnection-21936] davmail - Found permanently accepted certificate, hash *
DEBUG [CaldavConnection-21936] davmail - executeFollowRedirects(https://exchange./owa/)
DEBUG [CaldavConnection-21936] davmail - executeFollowRedirects: https://exchange./owa/auth/logon.aspx?url=https://exchange./owa/&reason=0 redirectCount:1
DEBUG [CaldavConnection-21936] davmail.exchange.ExchangeSession - Form based authentication detected
DEBUG [CaldavConnection-21936] davmail.exchange.ExchangeSession - Detected script based logon, redirect to form at https://exchange./owa/auth/logon.aspx?replaceCurrent=1&url=https%3a%2f%2fexchange.%2fowa%2f
DEBUG [CaldavConnection-21936] davmail - executeFollowRedirects(https://exchange./owa/auth/logon.aspx?replaceCurrent=1&url=https%3a%2f%2fexchange.%2fowa%2f)
DEBUG [CaldavConnection-21936] davmail - executeFollowRedirects(https://exchange./owa/auth/owaauth.dll)
DEBUG [CaldavConnection-21936] davmail - executeFollowRedirects: https://exchange./owa/ redirectCount:1
WARN [CaldavConnection-21936] davmail.exchange.ExchangeSession - Public folders not available: 401 Unauthorized at https://exchange./public/
DEBUG [CaldavConnection-21936] davmail.exchange.ExchangeSession - Current user email is @, alias is , mailPath is /exchange/@/ on Exchange2007
DEBUG [CaldavConnection-21936] davmail.exchange.ExchangeSession - Inbox URL: https://exchange./exchange/@/Inbox Trash URL: https://exchange./exchange/@/Deleted Items Sent URL: https://exchange./exchange/@/Sent Items Send URL: https://exchange./exchange/@/##DavMailSubmissionURI##/ Drafts URL: https://exchange./exchange/@/Drafts Calendar URL: https://exchange./exchange/@/Calendar Tasks URL: https://exchange./exchange/@/Tasks Contacts URL: https://exchange./exchange/@/Contacts Outbox URL: https://exchange./exchange/@/Outbox Public folder URL: /public/
DEBUG [CaldavConnection-21936] davmail.exchange.ExchangeSession - Session davmail.exchange.dav.DavExchangeSession@120bf2c created
DEBUG [CaldavConnection-21936] davmail.exchange.ExchangeSession - Created new session: davmail.exchange.dav.DavExchangeSession@120bf2c
ERROR [CaldavConnection-21936] davmail - java.lang.NullPointerException
java.lang.NullPointerException
at java.io.StringReader.(StringReader.java:33)
at davmail.exchange.XMLStreamUtil.createXMLStreamReader(XMLStreamUtil.java:155)
at davmail.caldav.CaldavConnection$CaldavRequest.parseXmlBody(CaldavConnection.java:1458)
at davmail.caldav.CaldavConnection$CaldavRequest.(CaldavConnection.java:1293)
at davmail.caldav.CaldavConnection.handleRequest(CaldavConnection.java:208)
at davmail.caldav.CaldavConnection.run(CaldavConnection.java:170)
DEBUG [CaldavConnection-21936] davmail - > HTTP/1.1 503 Service Unavailable
DEBUG [CaldavConnection-21936] davmail - > Server: DavMail Gateway 3.9.4-trunk
DEBUG [CaldavConnection-21936] davmail - > DAV: 1, calendar-access, calendar-schedule, calendarserver-private-events, addressbook
DEBUG [CaldavConnection-21936] davmail - > Date: Mon, 28 Nov 2011 15:24:23 +0000
DEBUG [CaldavConnection-21936] davmail - > Expires: Mon, 28 Nov 2011 15:24:23 +0000
DEBUG [CaldavConnection-21936] davmail - > Cache-Control: private, max-age=0
DEBUG [CaldavConnection-21936] davmail - > Content-Type: text/plain;charset=UTF-8
DEBUG [CaldavConnection-21936] davmail - > Connection: close
DEBUG [CaldavConnection-21936] davmail - > Content-Length: 30
DEBUG [CaldavConnection-21936] davmail - >
DEBUG [CaldavConnection-21936] davmail.caldav.CaldavConnection - > java.lang.NullPointerException

roundcube error log:

[28-Nov-2011 16:16:21] PHP Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /usr/local/www/roundcube/plugins/carddav/carddav_addressbook.php:408
Stack trace:
#0 /usr/local/www/roundcube/plugins/carddav/carddav_addressbook.php(408): SimpleXMLElement->__construct('')
#1 /usr/local/www/roundcube/plugins/carddav/carddav.php(240): carddav_addressbook->carddav_addressbook_sync()
#2 /usr/local/www/roundcube/plugins/carddav/carddav.php(414): carddav->carddav_addressbook_sync(65, false)
#3 [internal function]: carddav->carddav_server_save()
#4 /usr/local/www/roundcube/program/include/rcube_plugin_api.php(296): call_user_func(Array)
#5 /usr/local/www/roundcube/index.php(239): rcube_plugin_api->exec_action('plugin.carddav-...')
#6 {main}
thrown in /usr/local/www/roundcube/plugins/carddav/carddav_addressbook.php on line 408