我在我的系统上安装了AlchemyApi并获得了Api密钥。但是当我运行README.txt文件中提到的示例时,我得到以下错误:-
$java -jar ../dist/AlchemyAPI-Entity-Test.jar主线程"main"异常:连接超时在java.net.PlainSocketImpl.socketConnect(本机方法)java.net.AbstractPlainSocketImpl.doConnect (AbstractPlainSocketImpl.java: 327)java.net.AbstractPlainSocketImpl.connectToAddress (AbstractPlainSocketImpl.java: 193)java.net.AbstractPlainSocketImpl.connect (AbstractPlainSocketImpl.java: 180)java.net.SocksSocketImpl.connect (SocksSocketImpl.java: 384)java.net.Socket.connect (Socket.java: 546)java.net.Socket.connect (Socket.java: 495)sun.net.NetworkClient.doConnect (NetworkClient.java: 178)sun.net.www.http.HttpClient.openServer (HttpClient.java: 409)sun.net.www.http.HttpClient.openServer (HttpClient.java: 530)在sun.net.www.http.HttpClient。(HttpClient.java: 240)sun.net.www.http.HttpClient.New (HttpClient.java: 321)sun.net.www.http.HttpClient.New (HttpClient.java: 338)sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient (HttpURLConnection.java: 935)sun.net.www.protocol.http.HttpURLConnection.plainConnect (HttpURLConnection.java: 876)sun.net.www.protocol.http.HttpURLConnection.connect (HttpURLConnection.java: 801)sun.net.www.protocol.http.HttpURLConnection.getInputStream (HttpURLConnection.java: 1139)com.alchemyapi.api.AlchemyAPI.doRequest (AlchemyAPI.java: 869)com.alchemyapi.api.AlchemyAPI.GET (AlchemyAPI.java: 839)com.alchemyapi.api.AlchemyAPI.URLGetRankedNamedEntities (AlchemyAPI.java: 136)com.alchemyapi.api.AlchemyAPI.URLGetRankedNamedEntities (AlchemyAPI.java: 125)com.alchemyapi.test.EntityTest.main (EntityTest.java: 25)
一个问题是我无法从web浏览器访问AlchemyApi网站。我必须使用一个软件才能访问这个网站。但是,即使在进行了系统范围的设置之后,我也无法运行这些程序。我用的是Ubuntu。请在这个问题上指导我。
谢谢。
看起来您的java程序无法通过internet连接到AlchemyAPI。尝试一个示例Java程序来访问任何其他网站,并检查它是否成功。命令提示符权限是否有任何限制(尝试以管理员身份运行)?从eclipse试试关于eclipse安装