GAE全文搜索未在生产中查找导入

时间:2012-08-07 22:57:29

标签: google-app-engine

我在使全文搜索在GAE生产环境中工作时遇到问题。它在我的开发机器上工作正常,但是当我将它部署到生产环境时,我收到了这个错误:

com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'search' or call 'IndexDocument()' was not found.

这看起来是一个运行时问题,它无法找到正确的类,但我有WEB-INF / lib中包含的appengine-api-1.0-sdk-1.7.0.jar所以我假设当部署到prod,它将使用该版本的GAE。我是否遗漏了GAE如何部署libs以生产产品? GAE SDK 1.7现在应该可以在生产中使用吗?

这些是我的进口商品:

  import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.search.Document;
import com.google.appengine.api.search.Field;
import com.google.appengine.api.search.GeoPoint;
import com.google.appengine.api.search.Index;
import com.google.appengine.api.search.IndexSpec;
import com.google.appengine.api.search.SearchServiceFactory;

//my instantiation
private static final Index INDEX = SearchServiceFactory.getSearchService()
              .getIndex(IndexSpec.newBuilder().setName("shared_index"));

它似乎使用的是1.7.0版本。这是我正在使用的版本的记录以及错误的堆栈跟踪:

E 2012-08-07 19:30:37.352

version: Google App Engine/1.7.0

W 2012-08-07 19:30:37.702

com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'search' or call 'IndexDocument()' was not found.
    at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher$1.runInContext(RpcStub.java:782)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455)
    at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:333)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
    at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher.rpcFinished(RpcStub.java:824)
    at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher.success(RpcStub.java:809)
    at com.google.net.rpc3.impl.client.RpcClientInternalContext.runCallbacks(RpcClientInternalContext.java:893)
    at com.google.net.rpc3.impl.client.RpcClientInternalContext.finishRpcAndNotifyApp(RpcClientInternalContext.java:798)
    at com.google.net.rpc3.impl.client.RpcNetChannel.afterFinishingActiveRpc(RpcNetChannel.java:1059)
    at com.google.net.rpc3.impl.client.RpcNetChannel.finishRpc(RpcNetChannel.java:907)
    at com.google.net.rpc3.impl.client.RpcNetChannel.handleResponse(RpcNetChannel.java:2255)
    at com.google.net.rpc3.impl.client.RpcNetChannel.messageReceived(RpcNetChannel.java:2062)
    at com.google.net.rpc3.impl.client.RpcNetChannel.access$2000(RpcNetChannel.java:143)
    at com.google.net.rpc3.impl.client.RpcNetChannel$TransportCallback.receivedMessage(RpcNetChannel.java:3117)
    at com.google.net.rpc3.impl.client.RpcChannelTransportData$TransportCallback.receivedMessage(RpcChannelTransportData.java:599)
    at com.google.net.rpc3.impl.wire.RpcBaseTransport.receivedMessage(RpcBaseTransport.java:417)
    at com.google.net.eventmanager.AbstractFutureTask$Sync.innerRun(AbstractFutureTask.java:260)
    at com.google.net.eventmanager.AbstractFutureTask.run(AbstractFutureTask.java:121)
    at com.google.net.eventmanager.EventManagerImpl.runTask(EventManagerImpl.java:578)
    at com.google.net.eventmanager.EventManagerImpl.internalRunWorkerLoop(EventManagerImpl.java:1002)
    at com.google.net.eventmanager.EventManagerImpl.runWorkerLoop(EventManagerImpl.java:884)
    at com.google.net.eventmanager.WorkerThreadInfo.runWorkerLoop(WorkerThreadInfo.java:136)
    at com.google.net.eventmanager.EventManagerImpl$WorkerThread.run(EventManagerImpl.java:1855)

1 个答案:

答案 0 :(得分:1)

我不确定WEB-INF / lib中包含的appengine-api-1.0-sdk-1.7.0.jar是否会将其部署为该版本。

如果您使用的是eclipse,您是否从首选项中选择了1.7 sdk - > google - > appengine

另外,你是如何部署的?如果您使用的是命令行,请确保使用/1.7sdk/bin/appcfg文件进行上载。如果您正在使用eclipse,请按上述方式设置首选项。

不知道上面......

我认为你需要建立你的IndexSpec

private static final Index INDEX = SearchServiceFactory.getSearchService()
              .getIndex(IndexSpec.newBuilder().setName("shared_index").build());