Hi,
i must admit that i have no in-depth knowledge of the spring-social project and just use it as a module in a big spring web project.
I found that when trying to update the status with special characters in UTF-8 (in particular we use the german umlaute äöü and the sz ß) i get an exception that leads me in a deceptive direction:
Is this a known issue? Does everybody except me know that twitter does not accept UTF-8? Is there a setter of the TwitterTemplate class that i missed?Code:Exception in thread "main" org.springframework.social.AccountNotConnectedException: Could not authenticate with OAuth. at org.springframework.social.twitter.TwitterResponseStatusCodeTranslator.translate(TwitterResponseStatusCodeTranslator.java:76) at org.springframework.social.twitter.TwitterTemplate.handleResponseErrors(TwitterTemplate.java:322) at org.springframework.social.twitter.TwitterTemplate.updateStatus(TwitterTemplate.java:139) at org.springframework.social.twitter.TwitterTemplate.updateStatus(TwitterTemplate.java:131) at de.******.scheduled.TwitterJob.main(TwitterJob.java:80)
I know that the question will come so i post the code but there is nothing special about it:
Thanks in advanceCode:public class TwitterJob { public static final String API_KEY = "***"; public static final String API_SECRET = "***"; public static final String ACCESS_TOKEN = "***"; public static final String ACCESS_TOKEN_SECRET = "***"; public static void main(String[] args) { TwitterTemplate tt = new TwitterTemplate(API_KEY, API_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET); tt.updateStatus("test normal"); // works tt.updateStatus("test umlaute äöü"); // EXCEPTION !!! } }
Lori


Reply With Quote