Exception when trying to get the Exchange client module to work

3
Hi all, I'm checking out the new Exchange client (2007 and up) from the Mendix AppStore (v1.0.1), but I can't get it to work properly. I have an Exchange 2010 server that I want to connect to, which is set up 'out-of-the-box', without any further configuration. I've created a mailbox, which I can access using Outlook Web Access. I can also successfully access the Exchange Web Services URL at https://exchange/EWS/Exchange.asmx. UPDATE: I did need to configure Basic authentication on the EWS virtual directory in IIS, which I did. Now, when I configure a user in the Mendix Exchange client and press the 'Edit folder settings' button, I get the exception printed below. I have found that the Mendix runtime copies the 'cacerts' keystore to the deployment/model/resources directory, but changes the keystore password. Maybe that is the reason of the exception? Perhaps the EWSJ library tries to access the SSL truststore itself? UPDATE 2: It works! Removing the Exchange SSL certificate from the Modeler Project Settings did the trick (thanks Arjen!). I've just added it again, resulting in the same exception. Maybe worth mentioning in the AppStore documentation? Thanks, Jonathan van Alteren - FlowFabric DEBUG [jec.httpclient3.HttpMethodDirector] java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl) java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl) at javax.net.ssl.DefaultSSLSocketFactory.throwException(SSLSocketFactory.java:179) at javax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java:212) at jec.httpclient3.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:82) at jec.httpclient3.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:127) at jec.httpclient3.HttpConnection.open(HttpConnection.java:707) at jec.httpclient3.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387) at jec.httpclient3.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) at jec.httpclient3.HttpClient.executeMethod(HttpClient.java:397) at jec.httpclient3.HttpClient.executeMethod(HttpClient.java:323) at jec.b.b.a(Unknown Source) at jec.b.b.for(Unknown Source) at jec.EWSConnector.getAllFolders(Unknown Source) at exchangeclient.helpers.ConnectorCallerEWSJ.getAllFolders(ConnectorCallerEWSJ.java:46) at exchangeclient.actions.FolderImport.importFoldersEWSJ(FolderImport.java:180) at exchangeclient.actions.FolderImport.executeAction(FolderImport.java:67) at exchangeclient.actions.FolderImport.executeAction(FolderImport.java:31) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:49) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:473) at it.b(SourceFile:155) at com.mendix.core.Core.execute(SourceFile:191) at hi.a(SourceFile:70) at kM.a(SourceFile:67) at eR.executeAction(SourceFile:96) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:49) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:473) at it.b(SourceFile:155) at com.mendix.core.Core.execute(SourceFile:191) at dB.execute(SourceFile:183) at ju.a(SourceFile:299) at ju.a(SourceFile:230) at ju.processRequest(SourceFile:174) at fF.a(SourceFile:71) at com.mendix.core.MxRuntime.processRequest(SourceFile:924) at com.mendix.m2ee.server.handler.RuntimeHandler.handle(RuntimeHandler.java:42) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) at org.eclipse.jetty.server.Server.handle(Server.java:334) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559) at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1007) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:747) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:209) at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) at java.lang.Thread.run(Thread.java:662) Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl) at java.security.Provider$Service.newInstance(Provider.java:1245) at sun.security.jca.GetInstance.getInstance(GetInstance.java:220) at sun.security.jca.GetInstance.getInstance(GetInstance.java:147) at javax.net.ssl.SSLContext.getInstance(SSLContext.java:125) at javax.net.ssl.SSLContext.getDefault(SSLContext.java:68) at javax.net.ssl.SSLSocketFactory.getDefault(SSLSocketFactory.java:102) ... 42 more Caused by: java.io.IOException: Keystore was tampered with, or password was incorrect at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:771) at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:38) at java.security.KeyStore.load(KeyStore.java:1185) at com.sun.net.ssl.internal.ssl.TrustManagerFactoryImpl.getCacertsKeyStore(TrustManagerFactoryImpl.java:202) at com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl.getDefaultTrustManager(DefaultSSLContextImpl.java:70) at com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl.<init>(DefaultSSLContextImpl.java:40) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at java.security.Provider$Service.newInstance(Provider.java:1221) ... 47 more Caused by: java.security.UnrecoverableKeyException: Password verification failed at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:769) ... 59 more
asked
2 answers
1

I haven't seen this error myself yet. The Exchange library uses a separate keystore called 'privkeystore' in the resources folder though. I never heard of it changing a password.

You could ask your question on http://groups.google.com/group/jec-users2/topics which is the forum for the Exchange library

Update: this could be a conflict between our certificate store and the library's certificate store (if you imported certificates yourself). I may have found a fix for you though. There is a property 'disableCertificateSelfInstall' for the Exchange connector. I'm not 100% sure how this works or whether it will solve your issue but try changing this line of code in the EWSJConnectorInitializer.java file.

exConnector = factory.createEWSConnector(exchangeHost, userName, password, prefix, useSSL, mailboxName);

to:

exConnector = factory.createEWSConnector(exchangeHost, userName, password, prefix, useSSL, mailboxName, true);

This does mean you will have to import certificates from Exchange servers yourself though.

I'm very interested in the results.

answered
1

The Exchange client does not use the webservices but uses the ewsj java library. Is does n't support NTLMV2 as fas a I know. It didn't work with me either. Using the webservices would be better but that requires NLTM authentication on the webservice level, that is also not available (yet).

The only workaround is creating a proxy with Soap UI. This will be a service that does the authentication and publishes a webservice for Mendix. You still have to rewrite the Exchange Module for a major part.

Deployment will be complex in the last scenario.

answered