Closed saikiranvadlakonda closed 7 years ago
Hi.
The error seems related to a mismatch on the JAX-RS dependency. You said that you've added all the jars. Are you deploying the dependencies manually or using something like Gradle or Maven? A dependency manager is highly recommended as the JAX-RS runtime uses quite a few dependencies itself.
Yeah! I'm using gradle, actually it's a gradle project. Below is my gradle dependencies.
dependencies {
compile 'it.swim:swim-api-java:0.1.20170130085755'
compile 'it.swim:swim-server-java:0.1.20170206011444'
compile group: 'com.ganyo', name: 'gcm-server', version: '1.0.2'
// https://mvnrepository.com/artifact/com.sun.jersey/jersey-client
compile group: 'com.sun.jersey', name: 'jersey-client', version: '1.18.1'
// https://mvnrepository.com/artifact/com.sun.jersey/jersey-core
compile group: 'com.sun.jersey', name: 'jersey-core', version: '1.18.1'
// https://mvnrepository.com/artifact/com.sun.jersey.contribs/jersey-multipart
compile group: 'com.sun.jersey.contribs', name: 'jersey-multipart', version: '1.18.1'
// https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api
compile group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.0'
// https://mvnrepository.com/artifact/org.glassfish.jersey.core/jersey-client
compile group: 'org.glassfish.jersey.core', name: 'jersey-client', version: '2.25.1'
compile 'net.sargue:mailgun:1.3.2'
testCompile 'org.testng:testng:6.9.10'
}
Thank you for quick response.
I can see that you have a Jersey 1.x dependency on your gradle definition. This project uses Jersey 2.x.
You have both a 1.x and 2.x version of Jersey client in your definition. That won't work correctly. Does your project need Jersey 1.x?
Initially I was reading mailgun documentation, so that's why I've added those. Well I'll remove all those and check it out.
If you are not using JAX-RS/Jersey on your own project just don't add any dependency on jersey or jax-rs. I count 5 dependencies that you can remove.
Happy to say, It's working fine now. I've another doubt, how to send multiple to:saikiran, satish, ramesh using this API.
Great to be able to help.
As for your specific question: you just repeat the .to("recipient@example.com") invocation as many times as you want.
Hi, I would like to do other operations like retrieving stored messages, how could we achieve these type of operations. Could you kindly guide me.
This library is designed just to send messages. No other operations from the Mailgun API are supported or planned.
I'm running above code on stand alone Gradle Application, I've added all the jars, but still getting below Exception, could you guide me where I'm doing wrong.