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

Dependency on aws-java-sdk.version 1.9.6 #24

Closed
sanjaypujare opened this issue Jul 15, 2016 · 18 comments
Closed

Dependency on aws-java-sdk.version 1.9.6 #24

sanjaypujare opened this issue Jul 15, 2016 · 18 comments

Comments

@sanjaypujare
Copy link

I noticed that this library depends on aws-java-sdk-sqs version 1.9.6 which conflicts with aws-java core version 1.10.73 we would like to use. Can this dependency be upgraded to 1.10.73 since 1.9.6 seems quite old now? BTW, these 2 versions are incompatible as I found out the hard way

java.lang.NoSuchMethodError: com.amazonaws.AmazonWebServiceRequest.copyPrivateRequestParameters()Ljava/util/Map;

@jgangemi
Copy link

have you not tried just including the aws libraries you want directly in the pom and excluding the dependencies from this library?

i am currently using this library w/ 1.10.56 just fine.

@sanjaypujare
Copy link
Author

Thanks, I will try that. I wasn't aware of the POM dependency exclusion feature (I guess that's what you are referring to) and try 1.10.73.

@fgauthier
Copy link

An easy trap to fall into happens if you only add the following dependency to your pom:

    <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk</artifactId>
        <version> {aws-sdk-version > 1.9.6} </version>
    </dependency>

Where: {aws-sdk-version > 1.9.6} is some version greater than 1.9.6

This will cause all aws jars to be included with the newer version except to the specific sqs jar - that one will still have version 1.9.6. The reason for this is due to the fact that the amazon-sqs-java-messaging-lib pom includes an explicit version 1.9.6 dependency for the aws-java-sdk-sqs artifact. The resulting mismatched versions lead to the NoSuchMethodError above.

To avoid this make sure you have the following dependency in your pom:

    <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-sqs</artifactId>
        <version> {aws-sdk-version > 1.9.6} </version>
    </dependency>

@sanjaypujare
Copy link
Author

I tried jgangemi 's suggestion and it worked. Thx

@eitansela
Copy link

@sanjaypujare
Have you modified the pom.xml of the amazon-sqs-java-messaging-lib jar and then you use it?
What should be the solution if I want to build it with gradle or maven? Then I will need my own repo to store this jar...

@sanjaypujare
Copy link
Author

Use the exclusion feature described here
https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html

This is for maven. Not sure about gradle.

On Tue, Jul 19, 2016 at 10:02 PM, Eitan Sela notifications@github.com
wrote:

@sanjaypujare https://github.com/sanjaypujare
Have you modified the pom.xml of the amazon-sqs-java-messaging-lib jar and
then you use it?
What should be the solution if I want to build it with gradle or maven?
Then I will need my own repo to store this jar...


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#24 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANgpjyWj4neHzw3Ete2iXJx3Ppl0wn8lks5qXav4gaJpZM4JN2Ub
.

@eitansela
Copy link

@sanjaypujare
Thanks for the quick answer!
Can you attach this part in pom.xml you have done to make it work, with the exclusion?
Thanks again.

@sanjaypujare
Copy link
Author

Here it is

  <groupId>com.amazonaws</groupId>

  <artifactId>aws-java-sdk-sqs</artifactId>

  <version>1.10.73</version>

  <scope>test</scope>

</dependency>

<dependency>

  <groupId>com.amazonaws</groupId>

  <artifactId>amazon-sqs-java-messaging-lib</artifactId>

  <version>1.0.0</version>

  <scope>test</scope>

  <exclusions>

    <exclusion>

      <groupId>com.amazonaws</groupId>

      <artifactId>aws-java-sdk-sqs</artifactId>

    </exclusion>

  </exclusions>

</dependency>

On Tue, Jul 19, 2016 at 10:11 PM, Eitan Sela notifications@github.com
wrote:

@sanjaypujare https://github.com/sanjaypujare
Thanks for the quick answer!
Can you attach this part in pom.xml you have done to make it work, with
the exclusion?
Thanks again.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#24 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANgpj5gSJbHRkOcNjDG8pucmMCF-q0rEks5qXa4RgaJpZM4JN2Ub
.

@joshuadavis
Copy link

joshuadavis commented Jul 22, 2016

I've got a similar issue with amazon-sqs-java-messaging-lib:1.0.0 and aws-java-sdk-sqs:1.11.8

I'm using Gradle and I'm overriding the aws-java-sdk-sqs version.

When the message is being acknowledged the following exception is thrown:

java.lang.NoSuchMethodError: com.amazonaws.services.sqs.AmazonSQS.deleteMessage(Lcom/amazonaws/services/sqs/model/DeleteMessageRequest;)V

@jgangemi
Copy link

up to 1.10.77 works w/o issue. the 1.11.x series seems to have broken compatibility (and aws needs to read up on semantic versioning).

hopefully we'll get a response on this soon.

@trex-amazon
Copy link
Contributor

We are aware of this issue and are working on a fix. Stay tuned.

Trevor @ AWS

@jgangemi
Copy link

does that mean some of the other things ppl have asked for, etc might also get addressed given this library is gonna get some love?

@trex-amazon
Copy link
Contributor

We are actively working on this JMS library and will continue to support it going forward.

@jgangemi
Copy link

awesome - i'd love to see #8 addressed since i want to use this library w/o the jms interface bits and catching exceptions that are never actually thrown is annoying, but that's a separate discussion.

@trex-amazon
Copy link
Contributor

This issue is now fixed.

@jgangemi
Copy link

it's great that this is fixed but you guys need to read up on semantic versioning - i don't think this qualifies as a bug fix.

@sidath80
Copy link

Hi Team,

I am getting following error when try to conect to the AWS sqs with following libs,

	<aws.sdk.version>1.11.192</aws.sdk.version>

            <groupId>com.amazonaws</groupId>
		<artifactId>amazon-sqs-java-messaging-lib</artifactId>
		<version>1.0.0</version>

14:07:16,927 WARN [org.springframework.jms.listener.DefaultMessageListenerContainer] Setup of JMS message listener invoker failed for destination 'testq' - trying to recover. Cause: com.amazonaws.services.sqs.AmazonSQS.deleteMessage(Lcom/amazonaws/services/sqs/model/DeleteMessageRequest;)V

thanks

@CristiGuran
Copy link

Hi,
I have the same problem. I have tried with thea latest sdk-sqs version.
In my pom.xml I have only this:

com.amazonaws
aws-java-sdk-sqs
1.11.417

My dependency:tree shows only these additional dependencies from a library I added:
+- com.amazonaws:aws-java-sdk-s3:jar:1.11.201:compile
[INFO] | | | +- com.amazonaws:aws-java-sdk-kms:jar:1.11.201:compile
[INFO] | | | - com.amazonaws:jmespath-java:jar:1.11.201:compile

Do I need to add anything else?
Thanks!

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

8 participants