Access to Google Vision Api from Eclipse

1 view
Skip to first unread message

Majico via StackOverflow

unread,
May 17, 2017, 4:58:06 AM5/17/17
to google-appengin...@googlegroups.com

I have followed this guide to use Google Vision Api, but I have always the following error:

java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "shutdownHooks")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
at java.security.AccessController.checkPermission(AccessController.java:884)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:442)
at java.lang.Runtime.addShutdownHook(Runtime.java:209)
at com.google.common.util.concurrent.MoreExecutors$Application.addShutdownHook(MoreExecutors.java:223)

I have done all the steps in this video to use Service Account, but I can not translate the following code,which is for Storage, to be used for Vision Api:

private volatile static Storage instance = null;
InputStream authFile = null;
authFile = new FileInputStream(new File("WEB-INF/myJsonServiceAccount.json"));
instance = StorageOptions.newBuilder().setCredentials(ServiceAccountCredentials.fromStream(authFile))
                            .build().getService();

How should I use Service account for Vision Api ?



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/44020027/access-to-google-vision-api-from-eclipse
Reply all
Reply to author
Forward
0 new messages