TwitterException: connect timed out


connect timed out

Hello everyone.
I’m having a problem that does not know how to solve. I am creating my first app java, but it not working:

connect timed out
Relevant discussions can be found on the Internet at: or
TwitterException{exceptionCode=[bfb606ed-4ef9708b bfb606ed-4ef97061], statusCode=-1, message=null, code=-1, retryAfter=-1, rateLimitStatus=null, version=3.0.3}
at twitter4j.internal.http.HttpClientImpl.request(
at twitter4j.internal.http.HttpClientWrapper.request(
at twitter4j.auth.OAuthAuthorization.getOAuthRequestToken(
at twitter4j.auth.OAuthAuthorization.getOAuthRequestToken(
at twitter4j.TwitterBaseImpl.getOAuthRequestToken(
at twitter4j.TwitterBaseImpl.getOAuthRequestToken(

This is my code:

public class Autorizacion { Autorizacion() throws IOException, TwitterException { ConfigurationBuilder configBuilder = new ConfigurationBuilder(); configBuilder.setDebugEnabled(true) .setOAuthConsumerKey("XXXXXXXXXXXXXXXX") .setOAuthConsumerSecret("XXXXXXXXXXXXXXXXXXXXXXXXXXX");

Twitter OAuthTwitter = new TwitterFactory(;
RequestToken requestToken = null;
AccessToken accessToken = null;
String url = null;
do {
try {
System.out.println(“quiero obtener el request token”);
requestToken = OAuthTwitter.getOAuthRequestToken();
/* the error occurs on this line */

I read about it, but did not reach any conclusions. Thank you.