I am developing crm struts web application in eclipse. For mailing purpose i created mailchimp account and mandrill integration. I found third party wrapper api (cribbstechnologies-Java-Mandrill-Wrapper). while executing from main method it gives exception like below. I provided currect API code, All mail informations in MandrillHTMLMessage object.
private BaseMandrillResponse performPostRequest(BaseMandrillRequest request, String serviceMethod, Object responseClass, TypeReference reference) throws RequestFailedException {
try {
System.out.println("PostRequest Starts");
request.setKey(config.getApiKey());
HttpPost postRequest = new HttpPost(config.getServiceUrl() + serviceMethod);
String postData = getPostData(request);
………….
protected String getPostData(BaseMandrillRequest request) throws JsonGenerationException, JsonMappingException, IOException {
return objectMapper.writeValueAsString(request);
}
Exception at objectMapper.writeValueAsString(request); line like below
Exception in thread "main" java.lang.IllegalAccessError: tried to access method org.codehaus.jackson.JsonFactory._getBufferRecycler()Lorg/codehaus/jackson/util/BufferRecycler; from class org.codehaus.jackson.map.ObjectMapper
at org.codehaus.jackson.map.ObjectMapper.writeValueAsString(ObjectMapper.java:1030)
at com.cribbstechnologies.clients.mandrill.request.MandrillRESTRequest.getPostData(MandrillRESTRequest.java:102)
at com.cribbstechnologies.clients.mandrill.request.MandrillRESTRequest.performPostRequest(MandrillRESTRequest.java:47)
at com.cribbstechnologies.clients.mandrill.request.MandrillRESTRequest.postRequest(MandrillRESTRequest.java:38)
at com.cribbstechnologies.clients.mandrill.request.MandrillMessagesRequest.sendMessage(MandrillMessagesRequest.java:33)
at com.cribbstechnologies.clients.mandrill.it.MessagesTest.testSendMessage(MessagesTest.java:86)
at com.cribbstechnologies.clients.mandrill.it.MessagesTest.before(MessagesTest.java:63)
at com.cribbstechnologies.clients.mandrill.it.MessagesTest.beforeClass(MessagesTest.java:56)
at com.cribbstechnologies.clients.mandrill.it.SendMail.main(SendMail.java:9)
how to solve the exception. i tried in google but no result found.
Please anyone help me…
Thanks in advance…
Have you tried reaching out to the author on Github?
https://github.com/cribbstechnologies/Java-Mandrill-Wrapper
I would file an issue with them directly if the library is acting up. I don’t have enough context from your posting here to troubleshoot it directly.
There are also some integration tests that may help illuminate usage, if there is any confusion:
https://github.com/cribbstechnologies/Java-Mandrill-Wrapper/blob/master/src/test/java/com/cribbstechnologies/clients/mandrill/request/MandrillUsersRequestTest.java