0
我創建了一個AppEngine項目並使用sample java project作爲起點。我想我的應用程序能夠連接到雲存儲,所以我通過getting started文檔去,並添加以下的骨架應用:如何從AppEngine訪問雲數據存儲?
datastore = DatastoreFactory.get().create(DatastoreHelper.getOptionsfromEnv()
.dataset(datasetId).build());
然後我構建和部署應用程序(appcfg.sh -A <project> update target/appengine-try-java-1.0
)和提出的要求並得到了在日誌中出現以下錯誤:
W 17:40:59.602 2015-05-20 200 0 B 4.12s /demo
172.26.42.164 - - [20/May/2015:14:40:59 -0700] "POST /demo HTTP/1.1" 200 0 - "Apache-HttpClient/4.2.5 (java 1.5)" "project-id.appspot.com" ms=4122 cpu_ms=4667 cpm_usd=0.000158 loading_request=1 instance=00c61b117c2949ed37017839e6c82982472c2c app_engine_release=1.9.21
W 17:40:59.394 com.google.api.services.datastore.client.DatastoreFactory makeClient: Not using any credentials
W 17:40:59.575 [s~project-id/1.384441993309831713].<stderr>: Error while doing datastore operation
W 17:40:59.575 [s~project-id/1.384441993309831713].<stderr>: DatastoreException(Login Required): beginTransaction 401
有什麼我需要建立AppEngine上讓它連接到數據存儲?它似乎無法在環境中找到任何憑據。
謝謝!男人,這很混亂。 – kristina