1

I get the following error when i'm trying to initialize the amazon sqs client with my credentials.

Exception in thread "main" java.lang.RuntimeException: Stub!
    at org.apache.http.params.AbstractHttpParams.<init>(AbstractHttpParams.java:5)
    at org.apache.http.params.BasicHttpParams.<init>(BasicHttpParams.java:6)
    at com.amazonaws.http.HttpClientFactory.createHttpClient(HttpClientFactory.java:73)
    at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:111)
    at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:60)
    at com.amazonaws.services.sqs.AmazonSQSClient.<init>(AmazonSQSClient.java:151)
    at com.amazonaws.services.sqs.AmazonSQSClient.<init>(AmazonSQSClient.java:132)

Here's the code that's causing it :

 public class SQSControllerTest {

    public static void main(String[] args) {

        AmazonSQS sqs = new AmazonSQSClient(new BasicAWSCredentials("xxxx", "xxxx"));
    }
}
2
  • What SDK (and version) are you using? Commented Jun 14, 2013 at 22:56
  • This happened to me when I used classes from Android SDK in a standard java project. This may help you: stackoverflow.com/questions/3896064/… Commented Sep 2, 2013 at 6:39

1 Answer 1

1

I just had this issue. It is a classpath issue.

I believe that the Android SDK has a copy of AbstractHttpParams that has this method stubbed out, so you want the http-core jar ahead of it on your build-path.

Hope this helps.enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.