我在运行程序时收到 Opencalasis.com 错误。
请检查下面的程序告诉我我们是否在这方面犯了任何错误。
package org.com.sample.jcalasis;
import java.io.IOException;
import mx.bigdata.jcalais.CalaisClient;
import mx.bigdata.jcalais.CalaisObject;
import mx.bigdata.jcalais.CalaisResponse;
import mx.bigdata.jcalais.rest.CalaisRestClient;
public class Demo {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
CalaisClient client = new CalaisRestClient("OpenCalais API key");
CalaisResponse response = client.analyze("Prosecutors at the trial of former Liberian President Charles Taylor "
+ " hope the testimony of supermodel Naomi Campbell "
+ " will link Taylor to the trade in illegal conflict diamonds, "
+ " which they say he used to fund a bloody civil war in Sierra Leone.");
}
}
我添加了 jackson-mapper-asl 和 jackson-core-asl 的番石榴罐和杰克逊罐。
错误是这样的:
Exception in thread "main" java.net.UnknownHostException: api.opencalais.com