山魈包装JAVA API [英] Mandrill Wrapper API JAVA
问题描述
我开发CRM在Eclipse支柱Web应用程序。对于邮件的目的,我创建mailchimp帐户和山魈整合。我发现第三方封装API(cribbstechnologies-Java的山魈-包装)。而来自主要方法执行它给了异常像下面。我在MandrillHTMLMessage对象提供当期的API code,所有邮件信息。
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);
}
在异常objectMapper.writeValueAsString(请求);行像下面
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.
请谁能帮我...
在此先感谢...
推荐答案
你试过伸手笔者在Github?
https://github.com/cribbstechnologies/Java-Mandrill-Wrapper
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.
也有一些集成测试,可以帮助照亮的使用,如果有任何困惑:
<一href=\"https://github.com/cribbstechnologies/Java-Mandrill-Wrapper/blob/master/src/test/java/com/cribbstechnologies/clients/mandrill/request/MandrillUsersRequestTest.java\" rel=\"nofollow\">https://github.com/cribbstechnologies/Java-Mandrill-Wrapper/blob/master/src/test/java/com/cribbstechnologies/clients/mandrill/request/MandrillUsersRequestTest.java
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
这篇关于山魈包装JAVA API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!