google cloud storage
I'm trying to follow GCS getting started guide - https://cloud.google.com/appengine/docs/java/googlecloudstorageclient/getstarted
it says that I should download the client library, i did it with git.
then it says:
In the Libraries tab, click Add External Jars. You must add the following JARs:
appengine-gcs-client.jar from wherever you installed the Cloud Storage client library
guava-15.0.jar from wherever you installed the Cloud Storage client library
joda-time-2.3.jar from wherever you installed the Cloud Storage client library
appengine-testing.jar from the App Engine install subdirectory /lib/testing.
appengine-api.jar from the App Engine install subdirectory /lib/impl.
appengine-api-stubs.jar from the App Engine install subdirectory /lib/impl.
but there are absolutly no jars in the download,
what am I missing??
Edit: I manage to find the missing jars on the web, now i get:
Exception in thread "main" java.util.ServiceConfigurationError: com.google.appengine.spi.FactoryProvider: Provider com.google.appengine.api.search.ISearchServiceFactoryProvider could not be instantiated at java.util.ServiceLoader.fail(ServiceLoader.java:224) at java.util.ServiceLoader.access$100(ServiceLoader.java:181) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:377) at java.util.ServiceLoader$1.next(ServiceLoader.java:445) at com.google.appengine.spi.ServiceFactoryFactory$1.run(ServiceFactoryFactory.java:148) at com.google.appengine.spi.ServiceFactoryFactory$1.run(ServiceFactoryFactory.java:130) at java.security.AccessController.doPrivileged(Native Method) at com.google.appengine.spi.ServiceFactoryFactory.getProvidersUsingServiceLoader(ServiceFactoryFactory.java:130) at com.google.appengine.spi.ServiceFactoryFactory.access$100(ServiceFactoryFactory.java:39) at com.google.appengine.spi.ServiceFactoryFactory$RuntimeRegistry.(ServiceFactoryFactory.java:109) at com.goo gle.appengine.spi.ServiceFactoryFactory.getFactory(ServiceFactoryFactory.java:67) at com.google.appengine.api.datastore.DatastoreServiceFactory.getFactory(DatastoreServiceFactory.java:78) at com.google.appengine.api.datastore.DatastoreServiceFactory.getDatastoreService(DatastoreServiceFactory.java:20) at com.google.appengine.api.datastore.DatastoreServiceFactory.getDatastoreService(DatastoreServiceFactory.java:40) at com.google.appengine.tools.cloudstorage.dev.LocalRawGcsService.(LocalRawGcsService.java:87) at com.google.appengine.tools.cloudstorage.dev.LocalRawGcsServiceFactory.createLocalRawGcsService(LocalRawGcsServiceFactory.java:29) at com.google.appengine.tools.cloudstorage.GcsServiceFactory.createRawGcsService(GcsServiceFactory.java:66) at com.google.appengine.tools.cloudstorage.GcsServiceFactory.createGcsService(GcsServiceFactory.java:44) at com.google.appengine.tools.cloudstorage.GcsServiceFactory.createGcsService(GcsServiceFactory.java:40) at com.google.appengine.demos.LocalE xample.(LocalExample.java:54) at com.google.appengine.demos.LocalExample.main(LocalExample.java:129) Caused by: java.lang.VerifyError: class com.google.appengine.repackaged.com.google.appengine.api.search.SearchServicePb$DeleteDocumentRequest overrides final method getUnknownFields.()Lcom/google/appengine/repackaged/com/google/protobuf/UnknownFieldSet; at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at com.google.appengine.api.search.SearchServiceFactoryImpl.(SearchServiceFactoryImpl.java:13) at com.google.appengine.api.search.ISearchServiceFactoryProvider.(ISearchServiceFactoryProvider.java:16) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Met hod) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at java.lang.Class.newInstance(Class.java:379) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:373) ... 18 more
Seems like this guide was never actually tested, and is a complete waste of time, or what?
I got into the same troubles and what worked for me:
My build.gradle config now contains this:
dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.25'
compile 'com.google.appengine:appengine-endpoints:1.9.25'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.25'
compile 'com.googlecode.objectify:objectify:5.1.5'
compile 'javax.servlet:servlet-api:2.5'
testCompile 'junit:junit:4.12'
testCompile 'com.google.appengine:appengine-testing:1.9.25'
testCompile 'com.google.appengine:appengine-api-labs:1.9.25'
testCompile 'com.google.appengine:appengine-api-stubs:1.9.25'
}
链接地址: http://www.djcxy.com/p/63586.html
下一篇: 谷歌云存储