title: Update Status in Twitter via twitter4j Library - 401 Authontication Credentials... error
body: <p>Hi I am trying to implement "status update" via twitter4j library. </p>
  
  <p>However it am always getting the same error:</p>
  
  <blockquote>
    <p>401:Authentication credentials (<a href="https://dev.twitter.com/pages/auth" rel="nofollow">https://dev.twitter.com/pages/auth</a>)
    were missing or incorrect.</p>
    
    <p>Ensure that you have set valid consumer key/secret, access token/secret, and the system clock in in sync.</p>
    
    <p>TwitterException{exceptionCode=[6b80c41c-1bd1da85], statusCode=401,
    retryAfter=-1, rateLimitStatus=null,
    featureSpecificRateLimitStatus=null, version=2.2.5-SNAPSHOT(build:
    5f9c44cd0e0c1972f8d17653a226b9b6a3392ac2)}
    ...</p>
  </blockquote>
  
  <p>Below you can find the code piece:</p>
  
  <pre><code>ConfigurationBuilder cb = new ConfigurationBuilder();
          cb.setDebugEnabled(true)
          .setOAuthConsumerKey(cons_key)
          .setOAuthConsumerSecret(cons_secret)
          .setOAuthAccessToken(acc_token)
          .setOAuthAccessTokenSecret(acc_secret);
  
          TwitterFactory tf = new TwitterFactory(cb.build());
          Twitter twitter = tf.getInstance();
          twitter4j.Status status;
          try {
              status = twitter.updateStatus(params[0]);
              if (status.getId() == 0) {
                  System.out.println("Error occured while posting tweets to twitter");
              }
          } catch (TwitterException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  </code></pre>
  
  <p>I am pretty sure about I have the valid consumer/access tokens/secrets. </p>
  
  <p>I don't know how to sync the system clock. </p>
  
  <p>Do you have an idea what is the actual problem behind this error? I couldn't find any useful answer on internet.</p>
  
  <p>Any help would be appreciated..
  Thanks in advance!</p>