Skip to content

Instantly share code, notes, and snippets.

View mdeverdelhan's full-sized avatar

Marc de Verdelhan mdeverdelhan

View GitHub Profile
@mdeverdelhan
mdeverdelhan / AsyncMailSender.java
Last active June 21, 2019 19:31
Exception interception (AOP) and asynchronous mail sending with Spring
package com.mygroup.myapp.common.task;
import org.springframework.mail.MailException;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.scheduling.annotation.Async;
/**
* Asynchronous mail sender
*/
@mdeverdelhan
mdeverdelhan / CallingDialog.java
Created November 15, 2012 14:38
Setting global UI for Swing buttons
JOptionPane.showConfirmDialog(this, confirmMessage, confirmTitle, JOptionPane.YES_NO_OPTION);
@mdeverdelhan
mdeverdelhan / Twitter-Exception_Bad-Authentication-data
Last active December 23, 2015 17:29
Posting a tweet using Twitter4J.
400:The request was invalid. An accompanying error message will explain why. This is the status code will be returned during version 1.0 rate limiting(https://dev.twitter.com/pages/rate-limiting). In API v1.1, a request without authentication is considered invalid and you will get this response.
message - Bad Authentication data
code - 215
Relevant discussions can be found on the Internet at:
http://www.google.co.jp/search?q=b2b52c28 or
http://www.google.co.jp/search?q=10981ab8
TwitterException{exceptionCode=[b2b52c28-10981ab8], statusCode=400, message=Bad Authentication data, code=215, retryAfter=-1, rateLimitStatus=null, version=3.0.3}
at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:177)
at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:61)