Forums » Bugs & Problems Search

java.io.IOException: Can't send command New Reply

Author Post
Posts: 3
Registered: Oct 06, 2011

Hey,

I put the Java libs in my project, but when I run the example code, I get an error : java.io.IOException: Can't send command

public static void main(String[] args) throws EchoNestException {
    EchoNestAPI echoNest = new EchoNestAPI(MY_API_KEY);
    List<Artist> artists = echoNest.searchArtists("Weezer");

    if (artists.size() > 0) {
        Artist weezer = artists.get(0);
        System.out.println("Similar artists for " + weezer.getName());
        for (Artist simArtist : weezer.getSimilar(10)) {
            System.out.println("   " + simArtist.getName());
        }
    }
}

What is wrong?

Posts: 1098
Registered: Sep 08, 2008

lyrebird - hmmm - hard to tell. That example should work if you have internet connectivity and your API key is a valid key. -- Paul

Posts: 3
Registered: Oct 06, 2011

Hhm.. strange... I will test it on another machine

Posts: 1098
Registered: Sep 08, 2008

For debugging, try turning on tracing with echoNest.setTraceSends(true);

This should cause your app to print out the URLs that it is using to access the Echo Nest API. C&P that same URL into your browser to see if it works.

Paul

Posts: 2
Registered: Nov 29, 2011

i am getting the same problem. URL is working in browser but example code gives exception : Can't send command. How it will work ?

Thanks

Posts: 1098
Registered: Sep 08, 2008

preety - your situation is puzzling. Is it possible that you are behind a proxy? Your web browser may know about the proxy, but your java client may not. -- Paul

Posts: 2
Registered: Nov 29, 2011

Oh yes ... you got it right. it was the same problem. Thanks a lot. :)

Reply to this Thread

You must log in to post a reply.