我是GWT应用程序的新手,现在正在处理它。我有一个看起来很简单的问题,但我已经好几个小时没有解决了。我想通过这行代码通过P12密钥文件访问谷歌分析数据。
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
任何立即的帮助都将不胜感激。谢谢