java.lang.IllegalStateException: Consumer key and Consumer secret not supplied.


#1

/**

  • This Class is used to get the list of status.
    */

import twitter4j.Paging;
import twitter4j.ResponseList;
import twitter4j.Status;
import twitter4j.Twitter;
import twitter4j.TwitterFactory;
import twitter4j.auth.AccessToken;

public class TwitterClient {

public static void main(String[] args) {
	
	//
	Twitter twitter = new TwitterFactory().getInstance(new AccessToken("81756058-V75cJcFTmBCjaR9kiR0H57mWLxapvEJCJbec3MiR0","mzEkKGnT1rxs324MLcuAodmD0SdcpY54U5m2TTyXKZw"));
    
	//	My Applications Consumer and Auth Access Token
    twitter.setOAuthConsumer("OgopltrGd7TyxqEl0fadmA", "key");
   twitter.setOAuthAccessToken(new AccessToken("81756058-V75cJcFTmBCjaR9kiR0H57mWLxapvEJCJbec3MiR0", "key"));
    
    try {
    	
    	ResponseList<Status> a = twitter.getUserTimeline(new Paging(1,5));
    	
    	for(Status b: a) {
    		System.out.println(b.getText());
    	}

    }catch(Exception e ){
    	
    }
	
}

/*private static Object arrayToString(String string) {
	// TODO Auto-generated method stub
	return null;
}*/

}

Getting below Error :

Exception in thread “main” java.lang.IllegalStateException: Consumer key and Consumer secret not supplied.
at twitter4j.TwitterFactory.getInstance(TwitterFactory.java:131)
at TwitterClient.main(TwitterClient.java:17)

Please help


#2

Same problem :frowning:


#3

yes please help i am also getting the same problem