我正在 Eclipse 中开发 crm struts Web 应用程序。出于邮寄目的,我创建了 mailchimp 帐户和 mandrill 集成。我找到了第三方包装 api(cribbstechnologies-Java-Mandrill-Wrapper)。从 main 方法执行时,它会给出如下所示的异常。我提供了正确的 API 代码,MandrillHTMLMessage 对象中的所有邮件信息。
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(request) 处的异常;像下面这样的线
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)
如何解决异常。我在谷歌上试过,但没有找到结果。
请任何人帮助我...
提前致谢...