0
votes

I installed AlchemyApi on my system and also obtained the Api key. But when I run the examples as mentioned in the README.txt file, I get the following errors:-

AlchemyAPI_Java-0.8/testdir$java -jar ../dist/AlchemyAPI-Entity-Test.jar

`Exception in thread "main" java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384) at java.net.Socket.connect(Socket.java:546) at java.net.Socket.connect(Socket.java:495) at sun.net.NetworkClient.doConnect(NetworkClient.java:178) at sun.net.www.http.HttpClient.openServer(HttpClient.java:409) at sun.net.www.http.HttpClient.openServer(HttpClient.java:530) at sun.net.www.http.HttpClient.(HttpClient.java:240) at sun.net.www.http.HttpClient.New(HttpClient.java:321) at sun.net.www.http.HttpClient.New(HttpClient.java:338) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:935) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:876) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:801) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139) at com.alchemyapi.api.AlchemyAPI.doRequest(AlchemyAPI.java:869) at com.alchemyapi.api.AlchemyAPI.GET(AlchemyAPI.java:839) at com.alchemyapi.api.AlchemyAPI.URLGetRankedNamedEntities(AlchemyAPI.java:136) at com.alchemyapi.api.AlchemyAPI.URLGetRankedNamedEntities(AlchemyAPI.java:125) at com.alchemyapi.test.EntityTest.main(EntityTest.java:25)

`

One issue is that I cannot access the AlchemyApi website from the web browser. I have to use tor software to access the website. But I am not able to run the programs even after making the tor settings system-wide. I am using Ubuntu. Kindly guide me on this issue.

Thanks.

1
"I cannot access the AlchemyApi website from the web browser" <-- don't you think this explains the error (connection timeout)? This is a network problem, not a Java problem...fge
yes... but after using the tor software for anonymous browsing I am able to view the website in web browser. So the problem is even after applying the proxy settings system-wide so that all the applications can use this proxy settings I am getting the above error. Is there any other work-around for it.???user1882391

1 Answers

0
votes

Looks like your java program is not able to connect to AlchemyAPI over internet. Try a sample Java program to access any other website and check if it is successful. Is there any restriction to command prompt permissions (try "Run as Administrator) ? Try from Eclispe Refer this answer on other post for eclipse setup