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

java.lang.NoSuchMethodError: javax.jms.MessageProducer.setDeliveryDelay #84

Open
mario-iheart opened this issue Feb 5, 2020 · 6 comments

Comments

@mario-iheart
Copy link

Hi
I am using spring JMS and amazon-sqs-java-messaging-lib:1.0.8

I have a JMS template bean as
final JmsTemplate jmsTemplate = new JmsTemplate(sqsConnectionFactory);

and I set the deliveryDelay as
jmsTemplate.setDeliveryDelay(30000L);

The problem is that while calling the method
jmsTemplate.convertAndSend

I get the below error

java.lang.NoSuchMethodError: javax.jms.MessageProducer.setDeliveryDelay(J)V at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:628) at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:608) at org.springframework.jms.core.JmsTemplate.lambda$send$3(JmsTemplate.java:586) at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:504) at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:584) at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:661)

After looking at the dependency tree of my project I found that
amazon-sqs-java-messaging-lib:1.0.8 uses geronimo-jms_1.1_spec in which the MessageProducer does not support setDeliveryDelay method, however I know that amazon-sqs-java-messaging-lib supports setDeliveryDelay since 1.0.6.

I got this to work by excluding geronimo-jms_1.1_spec as a transitive dependency and upgrading to geronimo-jms_2.0_spec manually in my build.gradle.

Will amazon-sqs-java-messaging-lib support geronimo-jms_2.0_spec or newer versions?
Is there a recommend way of setting the deliveryDelay using the JMS template?

Thanks

@gspaiva
Copy link

gspaiva commented Sep 9, 2020

I'm facing exactly the same problem.

@rmacqueen
Copy link

Same

2 similar comments
@ymywmk
Copy link

ymywmk commented Nov 19, 2021

Same

@rickssouza
Copy link

Same

@ptonev
Copy link

ptonev commented Mar 25, 2022

Someone to solve this?

@joaorodrigues-carlsberg
Copy link

this means your client is expecting JMS 2.0 and this lib only supports 1.1.
Do not use setDeliveryDelay, as it is not supported.

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

7 participants