Ashwin Lakshmanan
Ashwin Lakshmanan

Reputation: 149

Exception in thread "main" java.lang.RuntimeException: Stub! error when using amazon sqs.

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"));
    }
}

Upvotes: 1

Views: 1805

Answers (1)

Ben Scannell
Ben Scannell

Reputation: 164

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

Upvotes: 1

Related Questions