2

我想阅读 Outlook 日历。所以我首先开始尝试连接到服务器。我找到了http://code.msdn.microsoft.com/exchange-ews-java-api-12-1a5a1143并且只想连接并尝试一下。

我找到了一个例子并尝试了这个:

import microsoft.exchange.webservices.data.*;
...
public void test(){     
    ExchangeService es = new ExchangeService();
    ExchangeCredentials credentials = new WebCredentials("user", "Password");
}

它由 Exchange 服务崩溃:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpConnectionManager
at ExchangeTest.test(ExchangeTest.java:15)
at Window.main(Window.java:19)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpConnectionManager
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 2 more

我试图导入一个库,但没有得到正确的库,或者错误是其他原因。你能告诉我我需要哪个库或者我可以在哪里/如何修复它。谢谢。

我用的是Win7。

4

1 回答 1

1

您需要这个库Commons HttpClient并且您必须将此库添加到项目的构建路径中。

于 2014-07-03T08:20:12.953 回答