0
我正面臨着我的java swing應用程序的一個奇怪的情況。在我的電腦(win-7 x64和jre-7)中,它工作正常。我能夠在我的系統上運行jar文件,但是在安裝了jre7的Windows XP計算機上,它提供了以下錯誤跟蹤:能夠在一個系統上運行java應用程序,但不能在其他系統上運行
C:\Documents and Settings\HOME\Desktop\TweetTweetAsMuchYouTweet_jar>java -jar Tw
eetTweetAsMuchYouTweet.jar
401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing
or incorrect. Ensure that you have set valid consumer key/secret, access token/
secret, and the system clock is in sync.
Failed to validate oauth signature and token
Relevant discussions can be found on the Internet at:
http://www.google.co.jp/search?q=10f5ada3 or
http://www.google.co.jp/search?q=0276a2ab
TwitterException{exceptionCode=[10f5ada3-0276a2ab], statusCode=401, message=null
, code=-1, retryAfter=-1, rateLimitStatus=null, version=3.0.5}
at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:16
2)
at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.j
ava:61)
at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java
:98)
at twitter4j.auth.OAuthAuthorization.getOAuthRequestToken(OAuthAuthoriza
tion.java:122)
at twitter4j.auth.OAuthAuthorization.getOAuthRequestToken(OAuthAuthoriza
tion.java:104)
at twitter4j.TwitterBaseImpl.getOAuthRequestToken(TwitterBaseImpl.java:2
98)
at Account.getAccessTokenAfterAuthentication(Account.java:45)
at Account.<init>(Account.java:33)
at AddFormWin$1.actionPerformed(AddFormWin.java:75)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
如果我們注意到行:
Authentication credentials (https://dev.twitter.com/pages/auth) were missing
or incorrect. Ensure that you have set valid consumer key/secret, access token/
secret, and the system clock is in sync.
Failed to validate oauth signature and token
認證由於無效的使用者密鑰/祕密失敗。但爲什麼Windows 7機器上的同一個應用程序運行完美?
請注意,在我的應用程序中,我使用Twitter4j(v-3.0.5)的oob(PIN based)身份驗證。作爲一名Java開發人員,我對此感到非常驚訝,因爲Java以其平臺獨立性而聞名。那麼java的平臺獨立性有什麼問題嗎?
請求引腳的瀏覽器窗口未打開。我認爲問題是這樣的:「和系統時鐘同步。」可能是因爲系統時鐘不同步,這就是爲什麼它給了我錯誤。 – rahulserver