Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNS create topic exception (v1.10.12) #496

Closed
gibbonsj opened this issue Aug 22, 2015 · 2 comments
Closed

SNS create topic exception (v1.10.12) #496

gibbonsj opened this issue Aug 22, 2015 · 2 comments

Comments

@gibbonsj
Copy link

Beginning with 1.10.12 the SNS create topic method throws the following exception:

java.lang.NoSuchFieldError: INSTANCE
at com.amazonaws.http.conn.SdkConnectionKeepAliveStrategy.getKeepAliveDuration(SdkConnectionKeepAliveStrategy.java:48)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:535)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:728)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:489)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:310)
at com.amazonaws.services.sns.AmazonSNSClient.invoke(AmazonSNSClient.java:2459)
at com.amazonaws.services.sns.AmazonSNSClient.createTopic(AmazonSNSClient.java:1133)
at com.amazonaws.services.sns.AmazonSNSClient.createTopic(AmazonSNSClient.java:2135)
...

Reverting back to SDK version <= 1.10.11 fixes the problem.

Code:

    Region reg = Region.getRegion(Regions.fromName(region));
    InstanceProfileCredentialsProvider cred = new InstanceProfileCredentialsProvider();

    sns = new AmazonSNSClient(cred);
    CreateTopicResult createTopicResult = sns.createTopic("ses-results");  // Exception starting here
    final String sns_arn_topic = createTopicResult.getTopicArn();

The code is pretty straight-forward and reverting back to 1.10.11 works without exception. Any insight would be appreciated.

@david-at-aws
Copy link
Contributor

What version of the Apache HttpClient are you using? This exception means your version's DefaultConnectionKeepAliveStrategy class is missing the public static INSTANCE member that the SDK started referencing in 1.10.12. As far as I can tell it's been there since 4.3.

@gibbonsj
Copy link
Author

@david-at-aws It was a versioning issue. An older HttpClient was getting loaded in a fat jar. Our end is fixed now. Thank you for pointing me in the right location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants