I am having a problem similar to this . I have a GAE application and a GCE application that seems to work fine in the cloud, but it's hard for me to work with the on-premises environment so that they both access the same data store.
I installed a local data store, as described in the link above, except that my code looks like this (I had to build it in such a way as to make it work in the cloud):
print("Connecting to datastore - " + datasetId); // Get credentials form GCE if not local. Credential computeEngineCredential = DatastoreHelper.getComputeEngineCredential(); if(computeEngineCredential != null) { print("Compute Engine Credetianls are not null! Access token: " + computeEngineCredential.getAccessToken()); } DatastoreOptions options = DatastoreHelper.getOptionsfromEnv().credential(DatastoreHelper.getComputeEngineCredential()).dataset(datasetId).build(); print("Connection Host: " + options.getHost()); print("Connection Dataset: " + options.getDataset()); datastore = DatastoreFactory.get().create(options);
When I launch the GCE application locally and try to connect to a working GAE datastore, I get the following (I replaced the actual dataset identifier with "myDatasetId" in the output below):
- "myDatasetId"Connection Host: http://localhost:8888: "myDatasetId"com.google.api.services.datastore.client.DatastoreFactory makeClient:: : runQuery 404404 com.google.api.services.datastore.client.DatastoreException: 404404 at com.google.api.services.datastore.client.RemoteRpc.makeException(RemoteRpc.java:114) com.google.api.services.datastore.client.RemoteRpc.call(RemoteRpc.java:80) at com.google.api.services.datastore.client.Datastore.runQuery(Datastore.java:109)
- "myDatasetId"
Connection Host: http://localhost:8888
: "myDatasetId"
com.google.api.services.datastore.client.DatastoreFactory makeClient
:
: : runQuery 404
GAE ( 8888 ):
com.google.appengine.tools.development.AbstractModule startupINFO: http://localhost:8888/_ah/admincom.google.appengine.tools.development.LocalResourceFileServlet doGet: ://v1beta2/ / "myDatasetId" /runQuery
com.google.appengine.tools.development.AbstractModule startup
INFO: http://localhost:8888/_ah/admin
com.google.appengine.tools.development.LocalResourceFileServlet doGet
: :
//v1beta2/ / "myDatasetId" /runQuery
GCE GAE. , ( gcd.cmd- GCE). , , , - ?
, , GCD Tool :
SEVERE: App Engine. . java.lang.RuntimeException: . com.google.apphosting.utils.clearcast.ClearCast $CasterImpl.cast(ClearCast.java:385) com.google.apphosting.utils.clearcast.ClearCast.staticCast(ClearCast.java:252) com.google.apphosting.utils.clearcast.ClearCast.staticCast(ClearCast.java:263) at com.google.appengine.tools.development.agent.AppEngineDevAgent.premain(AppEngineDevAgent.java:61) at sun.reflect.NativeMethodAccessorImpl.invoke0 ( ) at sun.reflect.NativeMethodAccessorImpl.invoke( ) at sun.reflect.DelegatingMethodAccessorImpl.invoke( ) java.lang.reflect.Method.invoke( ) at sun.instrument.InstrumentationImpl.loadClassAndStartAgent( ) at sun.instrument.InstrumentationImpl.loadClassAndCallPremain( ) : java.lang.IllegalAccessException: Class com.google.apphosting.utils.clearcast.ClearCast $CasterImpl cess com.google.appengine.tools.development.agent. $Proxy0 "" at sun.reflect.Reflection.ensureMemberAccess( ) java.lang.reflect.AccessibleObject.slowCheckMemberAccess( ) java.lang.reflect.AccessibleObject.checkAccess( ) java.lang.reflect.Constructor.newInstance( ) com.google.apphosting.utils.clearcast.ClearCast $CasterImpl.cast(ClearCast.java:383) ... 9
, - GAE GCD Tool? .
Datastore Java Development Server (dev_appserver.sh) (gcd.sh).
dev_appserver.sh
gcd.sh
, Java, , , dev_appserver.sh , gcd.sh, -Ddatastore.backing_store=<project dir>/WEB-INF/appengine-generated/local_db.bin.
-Ddatastore.backing_store=<project dir>/WEB-INF/appengine-generated/local_db.bin
, . GAE local_db.bin, gcd eclipse, "-Ddatastore.backing_store" , .
. admin GAE, 8888 , , GAE, , gcd, gcd (8080), , GCE.
, , GAE GCE, , , , Entity , , . , GCE , GAE , - , , , , , local_db.bin, , .
dev_appserver.cmd ? , EAR ( ).
Source: https://habr.com/ru/post/1613439/More articles:Changing html content and url without reloading the page - javascriptCreate and debug targets right away for eclipse CDT with cmake - eclipseFailed to complete the query - sqlIONIC CLI could not add Android platform - androidshare datastore between GAE (ndb) and GCE (gcloud.datastore) in a test environment - google-app-engineHow to show popup in tvOS? - tvosCan we make an HTTPS call with a self-signed certificate and ATS permission - iosjava.lang. ClassNotFo undExcepti on in matlabR2014a - matlabПочему вы должны кодировать заголовок авторизации base64? - base64Error: the resource was not found that matches the specified name (in 'minHeight' with the value '? Attr / actionBarSize') - androidAll Articles