我正在使用 oauth2 使用 google fusion tables java 客户端在 java 中编写一个小型桌面应用程序。我能够打开浏览器,以便用户可以登录到他/她的谷歌帐户,但在登录后应用程序崩溃给我这个异常:
Please open the following address in your browser:
https://accounts.google.com/o/oauth2/auth?client_id=611708255166-npbqbne71spdn8fa1tfsegbl2msi8lsk.apps.googleusercontent.com&redirect_uri=http://localhost:63909/Callback&response_type=code&scope=https://www.googleapis.com/auth/fusiontables
Attempting to open that address in the default browser now...
2013-08-21 11:27:28.076:WARN::/Callback?code=4/V8EpwmnrtF48VjXerABWDPZNyllS.ov1iLPSii_IVshQV0ieZDAps5vxCgQI
java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.flushBuffer()V
at com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver$CallbackHandler.handle(LocalServerReceiver.java:220)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
所以看起来回调 uri 不起作用。我不希望我的回调 uri 指向任何网站,因为这是一个桌面应用程序,但我想以某种方式返回我的应用程序,让用户知道对融合表的调用已经完成。