Connect. Communicate. Collaborate. Securely.

Home » Developer Zone » API/SDK Writers » CalDAV/CardDAV Connector for Kerio Connect (I just can't get it to work (not even open a Https-Connection))
  •  
Xaserx8

Messages: 17
Karma: 0
Send a private message to this user
Hello Kerio Community/Developers,

I opened a topic here a few weeks ago(http : //forums.kerio.com/t/24987//), asking if anyone could help me creating contacts/calendars via code.

I have to say that i'm not very familiar with Java since i use vb.net most of the time.

I got the link to "CalDAV/CardDAV Connector for Kerio Connect"(https : //github.com/Kerio/cdav-connector) and downloaded it.

First I downloaded all the libraries.
Since the links in the readme.md weren't up to date i downloaded them manually using the library list in the readme.txt in the /lib folder.

Then I imported the "CalDAV/CardDAV Connector for Kerio Connect" project into Eclipse and added the jar-files.

I tried creating a .jar-File of this project but couldn't since i didn't have the builder "org.marven.ide.eclipse.marven2builder" and so I got MissingClassExceptions.

I downloaded marven and could create the jar-file but there was still MissingBuilder(org.marven.ide.eclipse.marven2builder) written in properties/builder
(still not sure if i installed marven the right way)
I also found out that there was a newer version of this marven plugin which means that the org.marven.ide.eclipse.marven2builder was replaced by the org.eclipse.m2e.core.maven2Builder.

After all of that i created a new project imported all the libraries and created a Main class in which I tried to open a https-connection and load the calendar-entries from the webserver:

public static void main(String[] args) {
   List<ServerCalendar> objCalendar;
   
   HTTPSConnection objConn = new HTTPSConnection("domain", "admin", "1234", 443, true);
   objCalendar = objConn.getCalendars();
   
   System.out.println(objCalendar.size());
				
   for(ServerCalendar c: objCalendar) {
   System.out.println(c.getDisplayName() + " " +    
   c.getColor());
   }
}



If I use Port 443 (Secure Http) I get the following error:

[Fatal Error] :3:3: Elementtyp "BR" muss mit dem entsprechenden Endtag "</BR>" beendet werden.
org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 3; Elementtyp "BR" muss mit dem entsprechenden Endtag "</BR>" beendet werden.
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown Source)
at zswi.protocols.caldav.CalendarsGetter.getCalendars(Calendars Getter.java:48)
at zswi.protocols.communication.core.HTTPSConnection.getCalenda rs(HTTPSConnection.java:312)
at cwKerioClient.Main.main(Main.java:24)


I think the server response is in HTML but the connection is expecting HTML so the line breaks can't be handled.

Then I tried using Port 8800 (Http) and got the following error:

javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at sun.security.ssl.SSLSessionImpl.getPeerCertificates(Unknown Source)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVer ifier.java:126)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLS ocketFactory.java:572)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.op enConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(M anagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnec t(DefaultRequestDirector.java:645)
at org.apache.http.impl.client.DefaultRequestDirector.execute(D efaultRequestDirector.java:480)
at org.apache.http.impl.client.AbstractHttpClient.execute(Abstr actHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(Abstr actHttpClient.java:805)
at org.apache.http.impl.client.AbstractHttpClient.execute(Abstr actHttpClient.java:784)
at zswi.protocols.communication.core.HTTPSConnection.propfind(H TTPSConnection.java:510)
at zswi.protocols.communication.core.HTTPSConnection.getCalenda rs(HTTPSConnection.java:311)
at cwKerioClient.Main.main(Main.java:24)


I don't know if there's just a problem with the SSL-Certificates but either way i can't solve it.


I'm starting to think that i did everything wrong from the beginning.

Can anybody tell me if that's at least the right approach.
Or how I install the marven2builder.

Frankly I would be thankfull for any suggestion that might help.
I'm really stuck.

Thank you.
  •  
macti

Messages: 37
Karma: 3
Send a private message to this user
It's Maven, not Marven Smile I added the Maven support in Eclipse 3.7, and I think it should work with 3.7 and later. Which version of Eclipse do you have?

About the <br /> error, the current problem with the connector is that if Kerio send an error, the connector will try to parse the response as XML, but Kerio returns HTML when an error occurs. iCal Server does the same thing. The connector's code should be change so that the body of the response shouldn't be parsed if the status code in the response is >= 300. But anyway, if you got that error, that means you are able to connect, but an error occurred, might be the username or password.

I suggest that you use the debugger in Eclipse to see what is the response. You can also use log4j to log the request and response, with the following properties:

org.apache.http=DEBUG
org.apache.http=DEBUG
org.apache.http.wire=DEBUG

FYI, I'm working on adding auto-discovery support into the connector (see http://www.macti.ca/wiki/display/CAL/CalDAV+and+CardDAV+hand shake).
  •  
Xaserx8

Messages: 17
Karma: 0
Send a private message to this user
Thanks for your reply macti.
That's helping a lot.

Looks like I did something right.

I have the Eclipse version 4.3.0.v20130605-2000 which should be the newest (downloaded it 1-2 weeks ago from the homepage).

And of course it's Maven instead of Marven Rolling Eyes

So from what I understand from your post I don't have to add a Maven plugin to Eclipse.
But I guess I still have to install Maven.
What I did so far relating to marven is downloading Maven 3.0.5 from maven.apache.org/download.cgi and followed the installation instructions for Windows 2000/XP (I have win7 64bit).

But I still got the MissingBuilder(org.maven.ide.eclipse.maven2builder) in the project properties.

Can I just ignore that? Or do I have to tinker until the MissingBuilder-tag disappears?

[Updated on: Tue, 09 July 2013 16:45]

  •  
macti

Messages: 37
Karma: 3
Send a private message to this user
I don't know about Maven (I'm really not a Maven guy, I did the configuration to help out). But looks your problem is similar to this one: http://stackoverflow.com/questions/7625537/missing-builderor g-maven-ide-eclipse-maven2builder
  •  
Xaserx8

Messages: 17
Karma: 0
Send a private message to this user
I solved it.

The problem was the dafault_path.

I had to replace the ".../null/..." with the Kerio-Domain.
Didn't know or read anything about this.

Thank's for your help guys. it seems to be working.
I can read-out and create VCards and VEvents now.

[Updated on: Tue, 16 July 2013 13:21]

Previous Topic: A way to weekly import contacts (vCard 3) in the Public directory
Next Topic: KerioOutlookConnector with CalDAV/CardDAV Connector
Goto Forum:
  


Disclaimer:
Kerio discussion forums are intended for open communication between forum members and may contain information and material posted by members which may be useful in learning about Kerio products. The discussion forums are not intended to provide technical support for any specific product. Any information implied or expressed in the discussion forums is that of the posting member. Kerio is in no way responsible for the information posted in the forums, or its accuracy. Kerio employees may participate in the discussions, but their postings do not represent an offical position of the company on any issues raised or discussed. Kerio reserves the right to monitor and maintain the forums to promote free and accurate exchange of information.

Current Time: Wed Oct 18 02:05:01 CEST 2017

Total time taken to generate the page: 0.00421 seconds
.:: Contact :: Home ::.
Powered by: FUDforum 3.0.4.