0
我是GWT應用程序的新手,現在正在使用它。我有一個問題,看起來很簡單,但我已經解決了幾個小時了。我想通過這行代碼通過P12密鑰文件訪問谷歌分析數據。如何正確訪問gwtp服務實例中的文件?
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(httpTransport)
.setJsonFactory(jsonFactory)
.setServiceAccountId(serviceAccountMail)
.setServiceAccountPrivateKeyFromP12File(new File("src/main/webapp/WEB-INF/key","XXXXXX-77b2f9138e9612309473.p12"))
.setServiceAccountScopes(AnalyticsScopes.all()).build();
如果我通過運行它測試上面的代碼只是作爲Java應用程序,代碼工作正常。但是當我將GWT應用程序部署到tomcat並讓它運行時。我收到了錯誤。
Mon Feb 15 16:04:41 GMT+800 2016 mp.client.XXAsyncCallback WARNING:
ERROR:Type 'java.io.FileNotFoundException' was not included in the set of
types which can be serialized by this SerializationPolicy or its Class
object could not be loaded. For security purposes, this type will not
be serialized.
: instance = java.io.FileNotFoundException: XXXXXX-77b2f9138e9612309473.p12
(The system cannot find the file specified) from Service_Proxy.getData
任何直接的幫助將不勝感激。謝謝。