无法获取推特实例,请指出我做错了什么
代码 :
String consumerKey = "************************";
//Your Twitter App's Consumer Secret
String consumerSecret = "********************";
//Your Twitter Access Token
String accessToken = "**********************************";
//Your Twitter Access Token Secret
String accessTokenSecret = "*****************************";
//Instantiate a re-usable and thread-safe factory
TwitterFactory twitterFactory = new TwitterFactory();
//Instantiate a new Twitter instance
Twitter twitter = twitterFactory.getInstance(); /// **problem comes over here**
twitter.setOAuthConsumer(consumerKey, consumerSecret);
twitter.setOAuthAccessToken(new AccessToken(accessToken, accessTokenSecret));
从 twitter v1 迁移到 v1.1
java.lang.NoSuchMethodError: twitter4j.TwitterFactory.getInstance(Ltwitter4j/auth/AccessToken;)Ltwitter4j/Twitter; 在 com.verve.meetin.twitter.twitterAuthenticationServlet.doGet(twitterAuthenticationServlet.java:151) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:690) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java :803) 在 org.tukey.web.filters 的 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 的 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)。 urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) 在 org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) 在 org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter. java:92) 在 org.tukey.web.filters。