运行程序时出现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.");
}
}
我添加了guava jar和jackson jar的jackson-mapper-asl&杰克逊芯-ASL。
错误是这样的:
Exception in thread "main" java.net.UnknownHostException: api.opencalais.com
答案 0 :(得分:1)
API.opencalais.com在撰写本文时作出回应。所以,要么:
您可以使用常用的命令行工具诊断所有这些工具,ping和dig。